• 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

What is the function of the (new Date()).getTime() in PHP?

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

Debugging Stripe Webhook Event

Display the default discounted price and percentage on Woocommerce products

PHPExcel file download using AJAX call

PHP mail sending empty mails

str_word_count() function doesn't display Arabic language properly

Composer Warning: openssl extension is missing. How to enable in WAMP

Symfony process run throws exception - executing on command line works

advanced custom fields wordpress custom class

How to implement placeholder in a php file for moodle plugin?

Adding reCAPTCHA v2 into my PHP file

How to submit a form when page loads using JavaScript?

Calculating Median of an array in PHP

How to insert Google Adsense Code in PHP script?

About Contact Privacy policy Terms and conditions