• 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

add " ? " in url via htaccess RewriteRule

Getting public posts of a random user from Facebook API

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

php echo remove slashes from url [duplicate]

Why does array_map() with null as callback create an "array of arrays"?

PHP Slim Framework request using withAttribute error

Display the default discounted price and percentage on Woocommerce products

How to loop a tree array with unknown depth and get array blocks?

Malformed MIME header error in Symfony 5.3

How to change product Image when variables are selected in Shop and Archive Pages?

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

How can I easily switch between PHP versions on Mac OSX?

Utf8 encoding issue with Laravel

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Star and Half Star Rating in Laravel

About Contact Privacy policy Terms and conditions