• 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

Redis Command To Sort Keys

Why i get wrong output for html markdown?

Applying programmatically a coupon to an Order in WooCommerce3

Adding reCAPTCHA v2 into my PHP file

How to get page number on dompdf PDF when using "view"

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

Redirect to previous page with php

Laravel - How to properly generate unique slugs from article titles?

Two buttons one form

Connecting an HTML webpage to a SQL Server

Search for array row with specific column value and return another value from qualifying row

how to remove %20 in the url in php

PHP function Not Working As Expected From functions.php Include File

Python - Include another Python script

Unable to Edit config.inc.php

About Contact Privacy policy Terms and conditions