• 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 Displaying image from database

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Querying only one row from a one to many relationship laravel

Combine array with same value and add other [duplicate]

Woocommerce redirect after add-to-cart error

unable to load your default controller on Codeigniter

Cut an arabic string

Creating command to backup MySql database in Laravel

Add bold text and line break into Laravel Notification Email

How to KeyBy where multiple items have the same key

Laravel Model save() & update() Not Saving

file_get_contents() without "Http" to access external URL [closed]

Add record for each array elements if missing in table

How to fix Call to undefined method AppModelsTableName::factory?

No definition found for function in vendor vscode

About Contact Privacy policy Terms and conditions