• 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 You requested 1 items, but there are only 0 items available

merge all files in directory to one text file

How to add a sidebar to Woocommerce Shop Page?

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

Add Class in html Dynamically in PHP

Laravel update hasMany relationship using saveMany

How to show a popup modal in codeIgniter?

Wordpress how to get the post thumbnail inside a figure tag

Show rotation of tweets using current day of month

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Merge column values from two arrays to form an indexed array of associative arrays

Multiply each value in array using array_map function

laravel MVC execution flow

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

CodeIgniter 3 is generating a session file on each request, why?

About Contact Privacy policy Terms and conditions