• 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

Multiple order by in WooCommerce

Sum column values from multiple arrays

How to get total pages of PDF with FPDF?

Correctly determine if date string is a valid date in that format

PHP: Print caught exception like Xdebug

Why isn't my PHP exception working?

Required field only if another field has a value, must be empty otherwise

Toggle between a textbox and a select using PHP

Change user role if checkout custom checkbox is checked in WooCommerce

PHP array, move keys and values to new array, but mix it up

insert multiple rows in a saveall in cakephp

Currently Using CodeIgniter Framework i have an Error

Transfer data between JavaScript and PHP through JSON

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

About Contact Privacy policy Terms and conditions