• 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

PHP - installing Xdebug on Mac with XAMPP (Unix File)

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

Twig - How to check if variable is a number / integer

Parameter is not sent to Laravel route in Ajax

javascript html popup window

file_get_contents() without "Http" to access external URL [closed]

Need to display only array value in JSON output

Target Individual Form Instance/Counter Inside A PHP While Loop

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Add a custom text for a particular product on specific email notification in Woocommerce

Laravel 8 Multiple Relationships for Factory

Display Link Title Instead of URL in XSL

Laravel set default language not working

Whats the point of running Laravel with the command 'php artisan serve'?

PHP DOTENV unable to load env vars

About Contact Privacy policy Terms and conditions