• 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

SilverStripe unable to populate multiple member Childs

Reload parent page after submit in iframe

Array to string conversion

The sum of the user's points

How avoid Moved Permanently The document has moved here

wordpress function breaks wp-admin

Utf8 encoding issue with Laravel

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

How to create a video stream from a single dynamic image in PHP

Not able to override collapsible.js in magento 2

How can i call a function that executes an fpdf based on the choice of a form selector?

Get number of working days between two dates in PHP [duplicate]

Woocommerce product attributes with hierarchy like categories

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

Return multiple values from a function using mysqli_fetch_assoc [closed]

About Contact Privacy policy Terms and conditions