• 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

SQLSTATE[HY000]: General error: 1 table posts has no column named *

Get keys from associative array [duplicate]

Composer fails with kylekatarnls/update-helper on new homestead

PHP Include for HTML?

Assign output of PHP function to a variable

oauth-private.key does not exist or is not readable

Sagepay Error The Vendor failed to provide a RedirectionURL

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

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

Symfony autowiring issues since docker update

Get data from accuweather api url

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

About Contact Privacy policy Terms and conditions