• 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

phpunit - testing is painfully slow

How to run a shell as root from php (apache)

Add rows to Single product Additional information table in WooCommerce 3.6

How to make autocomplete work in foreach php loop? (vscode, intellisense)

MySQL order by field in Eloquent

Attempt to read property "view" on null when sending password reset email

Confirm Leave on External Links in Wordpress

PHP block shortcut in Visual Studio Code

Select option menu read from database and use it's values

Creating command to backup MySql database in Laravel

Make Shipping Method fields Mandatory on Woocommerce checkout page

Laravel Blade checkbox not checked

Store multiple fields in JSON column (Nova CMS)

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

How to give apache permission to write to home directory?

About Contact Privacy policy Terms and conditions