• 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

Laravel no logout option from menu after successfull login

how to prevent float variables displaying as scientific notation when printing [duplicate]

Symfony there are no commands defined in the "make" namespace

Return new collection without modifying original collection

Mysqli Output to a table

Symfony 4: "Autowire: you should configure its value explicitly."

How to skip cart page on woocomerce for certain products only?

Fatal error: Array callback has to contain indices 0 and 1

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

Composer fails with kylekatarnls/update-helper on new homestead

WordPress - Dynamically add user ID to the end of a URL

Prevent blank space in pdf pages (DomPdf)

How to map the two arrays with a duplicate value?

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

mysql slow on updates for a well optimized query

About Contact Privacy policy Terms and conditions