• 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 reset Laravel AuthManager/guards in between API calls in tests?

laravel MVC execution flow

Sum array values

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

MISSING UPDATES FOR: MEDIA Drupal 9

Python - Include another Python script

carbon generated datetime not stored correctly into the database

mysql_result is defined but mysql_free_result warns it expected a resource

Store multiple fields in JSON column (Nova CMS)

Comma separated list from array with "and" before last element

Correct way to use LIKE '%{$var}%' with prepared statements?

How to install LDAP in Docker php-fpm alpine

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

How do I set the maximum php memory limit

Why does using salted hash on python and php give me different results?

About Contact Privacy policy Terms and conditions