• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Mobile browsers are adding .html to filename on download

phpfilemobilefile-extensionvcf-vcard


PHP Snippet 1:

header('Content-Description: Download vCard');
header('Content-Type: text/vcard');
header('Content-Disposition: attachment; filename='.$your_filename_here);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
echo $vcard_serialized; //echo the content
exit;

Related Snippets

How to make dot match newline characters using regular expressions

Yii2: How to download backup files using spanjeta/yii2-backup?

Cannot pass null argument when using type hinting

How avoid Moved Permanently The document has moved here

Insert multidimensional array to codeigniter cart

Custom API and cunsuming in php?

Sum column values from multiple arrays

Laravel - Browser displays message again when I press back button

How to insert data from multiple select dropdown values into database?

How to auto populate preferredCountries from intl-tel-input with db output

how to youtube api data to print in toolset metabox using a button click before save-post

Apply session id from request header

Make Calculator - When Button clicked the No shows in Textbox.

How to delete old images from public folder on update using Laravel

Currently Using CodeIgniter Framework i have an Error

About Contact Privacy policy Terms and conditions