• 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

Laravel MSSQL Server Connection not working

renameColumn migration fails for existing column with columns does not exist error

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

add uri parameter to Route name in laravel

Laravel Multi-language routes without prefix

Warning: A non-numeric value encountered

how to remove white space in select 2

Wordpress how to get the post thumbnail inside a figure tag

WordPress Subquery returns more than 1 row on SELECT

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

PHP: set a (deep) array key from an array [closed]

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

Dropdown with current value from Mysql

Symfony Mercure "Failed to send an update"

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

About Contact Privacy policy Terms and conditions