• 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

PHP: convert all UTF-8 characters to HTML entities

I need to link Google Sheet with my Laravel

Split array into 4-element chunks then implode into strings

Add restriction to WooCommerce coupons by allowed user ID

Laravel passport auth token not working after moving to different server

retrieve data from database using session

laravel MVC execution flow

how to youtube api data to print in toolset metabox using a button click before save-post

Unable to run composer install

dockerizing Laravel + vue

Sentry on Symfony: how to exclude `NotFoundHttpException`

What is the function of the (new Date()).getTime() in PHP?

How to validate tin and cst using PHP?

How do I call a php file with axios?

how to upload binary image to sql server using php laravel

About Contact Privacy policy Terms and conditions