• 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

Adding custom body class to the custom archive pages

Stop caching for PHP 5.5.3 in MAMP

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

How to get multiple values with same key from an array PHP

Error converting docx to pdf using Unoconv

Transpose multidimensional array and join values with commas

Warning: sqlite_query() expects parameter 1 to be resource, string given

How to install php_imagick on wamp64

php echo xml documents with header

Laravel Database Strict Mode

Laravel: Why is my variable not being set while it's in the construct function of the controller?

How do I remove this delivery notification from here?

Adding multiple items to WooCommerce cart at once

PDOException SQLSTATE[HY000] [2002] No such file or directory

Having trouble with PDO queries (Notice: Undefined index)

About Contact Privacy policy Terms and conditions