• 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

PHP if in_array() how to get the key as well?

Assets not referencing to public folder (Laravel)

Input and output values for php into the browser?

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Auto increment id JSON

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

Changing font color in javascript

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

dompdf and img tag, image wont show

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

enable Apache http Authorization header

(Cache::lock()) -> get() -- Under what conditions does it return false?

Doctrine 2 mapping referencing unique key

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

PHP Array split string and Integers

About Contact Privacy policy Terms and conditions