• 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

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

How to convert the int value to inch in PHP [closed]

How to remove from a multidimensional array all duplicate elements including the original?

Smarty if isset

How can i update or reset my password without entering email field in laravel-8?

How to get the ID of the link in another page in php

Check If array is null or not in php

How do I Post to .txt document before form submits

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

phpunit - testing is painfully slow

XDebug not working in VScode for php debugging

PHP only Hit Counter?

Sagepay Error The Vendor failed to provide a RedirectionURL

How to render html from a @foreach loop in a textarea

Shopify password update using Shopify API

About Contact Privacy policy Terms and conditions