• 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

Session timeout in Yii2

WordPress - Dynamically add user ID to the end of a URL

Minimum order amount except for specific shipping method in WooCommerce

How can I get new CSRF token in LARAVEL by using ajax

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

using random function but it's displaying duplicates

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

mysql slow on updates for a well optimized query

best way to store error messages in Laravel (session or variable)

Sort multidimensional array by column value within a column

Combining a describing and one array with data

Dynamic table in HTML using MySQL and php

Can't find vendor/autoload.php for Ratchet

how to retrieve the first and last instance of a row in pdo dataset

Sum array values

About Contact Privacy policy Terms and conditions