• 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 5 session not persisting after user is logged in

Minimum order amount except for specific shipping method in WooCommerce

How to get company posts from LinkedIn via API?

CodeIgniter force_download is not working

Live search query using JS and PHP for QA forum

PHP password_verify

How do I call Validator from a namespace with an already existing Validator class

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

The "client_reference_id" argument is not passed

How to create laravel storage symbolic link for production or sub domain system?

Laravel views are showing from cache on one server but works fine on other server

Laravel Livewire: jQuery not working in child component loaded via @if statement

Laravel set default language not working

PHP Form Not Inserting

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

About Contact Privacy policy Terms and conditions