• 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

api response laravel doesn't show

Failing validation doesn't stop code execution in livewire component

Cannot connect to own websocket server when on secured domain

Laravel php artisan serve to mimic HTTPS

Issue saving card for customer

php echo xml documents with header

How to fix bootstrap multiselect search data using ajax

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Show rotation of tweets using current day of month

CodeIgniter 3 is generating a session file on each request, why?

How to make dot match newline characters using regular expressions

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Refresh specific HTML content that retrieves data from MySQL

How to send parameters in soap request in php in __soapcall() function

Send same name multiple checkbox values via ajax

About Contact Privacy policy Terms and conditions