• 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

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

Select option from dropdown menu with PHP and mySql

Laravel websockets AWS EC2 - Connection failed

How to make a array inside array?

Combine multiple columns into an array as one of the key in a results set

PHP -> Next nearest date defined by array of days in week

How to redirect to another page and call a Function there on Angular ng-click

could not find driver Debian SQL Server PHP

How to identify whether webp image is static or animated?

Must be of the type array, null given,

What is the difference between client-side and server-side programming?

How to get transaction details in notify_url page in paypal

Laravel no logout option from menu after successfull login

php curl requesting twice

How to separate letters and digits from a string in php

About Contact Privacy policy Terms and conditions