• 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 send image,audio or video through the WhatsApp API - PHP

Merge key and value of array index [duplicate]

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

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

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Reorder attribute dropdown terms in Woocommerce single variable products

Star rating with half star support

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Adding one microsecond to Datetime object in PHP

PHP array stringify

wp_remote_get() not passing authentication

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

Laravel 5 session not persisting after user is logged in

Center point of multiple gps coordinates with php

About Contact Privacy policy Terms and conditions