• 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

I can't delete my image when it is liked because of the foreign key in mysql

PHP SoapClient: set a namespace without prefix

How to override htaccees file for cache control header

Match single unknown parameter php (Morse-code Regex)

How to pass security cloudflare server with php curl

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

Xdebug can't connect back to Docker host

How to set time with DateTime modify?

How to test laravel controller method?

wordpress : How to specify the cause "This site can’t be reached"

Explain how this array transposing and flattening function works

Sum array values of a column within each column of an array with 3 levels

Timber: Single post pagination does not work (wp_link_pages)

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Adding reCAPTCHA v2 into my PHP file

About Contact Privacy policy Terms and conditions