• 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

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

PHP file_get_contents function

unable to load your default controller on Codeigniter

Find out the name of the last script that included the current one

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

Limit of log line written to Apache Errorlog from mod php error_log

How to retrieve Active Directory group policy maximum password age using LDAP

PHP, how to convert Int value to Week days

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Sentry on Symfony: how to exclude `NotFoundHttpException`

Split a string array into pieces

How to display table header in every page using FPDF library?

PHP: convert all UTF-8 characters to HTML entities

Laravel Multi-language routes without prefix

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

About Contact Privacy policy Terms and conditions