• 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

Check for PDO Results, If None Display Message, If Yes then Loop Through

Filter array by skipping every nth element from the end

How to override htaccees file for cache control header

PHP Array split string and Integers

Add record for each array elements if missing in table

Transform array, set each array element with parent key php

Google Gmail API - How to login programatically?

PDOException SQLSTATE[HY000] [2002] No such file or directory

How to send image,audio or video through the WhatsApp API - PHP

Correct way to use LIKE '%{$var}%' with prepared statements?

SilverStripe unable to populate multiple member Childs

Appending data to an anchor tag

Laravel Mix Uncaught ReferenceError: $ is not defined

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Laravel php artisan serve to mimic HTTPS

About Contact Privacy policy Terms and conditions