• 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: How to fetch id dynamically in a query builder?

Select option from dropdown menu with PHP and mySql

php - add comma thousands separator but remove trailing zeros

javascript html popup window

Distribute array row data to make multiple new rows

How to make a foreign key not using primary key

Can't find vendor/autoload.php for Ratchet

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

Prestashop cUrl Login

Querying only one row from a one to many relationship laravel

The sum of the user's points

Check if string contains a value in array [duplicate]

PHP password_verify

php script to delete files older than 24 hrs, deletes all files

Unit (real unit test) of test laravel relationship

About Contact Privacy policy Terms and conditions