• 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

Use Python plotly chart in PHP

PHP: Print caught exception like Xdebug

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Target class controller does not exist - Laravel 8

Reorder attribute dropdown terms in Woocommerce single variable products

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

Backend cannot be reached after Typo3 login screen

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

Laravel relationship belongsToMany with composite primary keys

Laravel database insert with combining array and string

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Utf8 encoding issue with Laravel

Transform array, set each array element with parent key php

Laravel UUID generation

Laravel update hasMany relationship using saveMany

About Contact Privacy policy Terms and conditions