• 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 5 session not persisting after user is logged in

Whats the point of running Laravel with the command 'php artisan serve'?

How to get total pages of PDF with FPDF?

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

PHP -> Next nearest date defined by array of days in week

Center point of multiple gps coordinates with php

Phalcon: setStatusCode returns empty response

Change the alert text on add to cart action without selected variation in Woocommerce

Creating a config file in PHP

Reducing authentication calls on external API (Laravel 5.6)

php retrieve specific data onclick from database in a list format

PHP only Hit Counter?

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

How to show a popup modal in codeIgniter?

About Contact Privacy policy Terms and conditions