• 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 loop through json response data using ajax jquery?

Warning: A non-numeric value encountered

phpunit - mockbuilder - set mock object internal property

retrieve data from database using session

PHP each() function replacement

Unable to create lockable file - Laravel 8 & PHP 8

Add custom text under order details on WooCommerce My account view order pages

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Calculating Median of an array in PHP

Composer Warning: openssl extension is missing. How to enable in WAMP

PHP DOTENV unable to load env vars

Server-sent events in PHP (without echo or print)

Upload a file Using PHP and JavaScript

How do I pass the dynamic output of a php variable or php function to a CSS variable?

Require a class from another class - php

About Contact Privacy policy Terms and conditions