• 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

Getting values for an enum?

How to Generate PDF invoice to XML format using mPDF

How to test a php login connected to a mysql db through xampp?

PHP 8 - libxml_disable_entity_loader() has been deprecated. How do I replace the functionality it provides?

How to submit a form when page loads using JavaScript?

How can i call a function that executes an fpdf based on the choice of a form selector?

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

PHP, how to convert Int value to Week days

How to get Laravel's CSRF Token from Another Website?

Xdebug in Laravel is not working with VSCode

PHP function Not Working As Expected From functions.php Include File

Laravel Command Schedule Not Working Properly

Make Calculator - When Button clicked the No shows in Textbox.

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

How to convert a carbon into string, to take the date only?

About Contact Privacy policy Terms and conditions