• 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 display table header in every page using FPDF library?

How to send upload image through email

TesseractOCR not working for Laravel

PHP each() function replacement

Google Calendar API batch request PHP

What is PHP's equivalent of JavaScript's "array.every()"?

oauth-private.key does not exist or is not readable

PHP mail sending empty mails

How to override htaccees file for cache control header

How to get AJAX to post on second page?

How to get values inside <![CDATA[values]] > using php DOM?

How to check user Permissions using Custom Middleware in Laravel

Error converting docx to pdf using Unoconv

Laravel Collections. Is there some kind of assertStructure method?

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

About Contact Privacy policy Terms and conditions