• 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 only Hit Counter?

How to send parameters in soap request in php in __soapcall() function

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

Store / Website Column in Magento 2 Admin Grid - Custom Module

PHP array_filter with arguments

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Calculating Median of an array in PHP

How avoid Moved Permanently The document has moved here

How update php.ini on a Mac OS X Mojave?

Sagepay Error The Vendor failed to provide a RedirectionURL

Lumen - Postgresql setup - Composer

how to check version of codeigniter framework?

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

PHP and WebView - Cookie doesn't are the same

About Contact Privacy policy Terms and conditions