• 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

CodeIgniter force_download is not working

MISSING UPDATES FOR: MEDIA Drupal 9

Clients authentication and user authentication with laravel

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

file_put_content...fail to open stream:Permission denied in Laravel 5

301 Redirect to remove query string on homepage only

Magento 2 - Controller returning blank page

Make certain characters of a word from string bold

How to Generate PDF invoice to XML format using mPDF

Laravel - Implicit route model binding with soft deleted data

Login if user is active using Laravel Breeze

Reducing authentication calls on external API (Laravel 5.6)

Problems getting instance of UploadedFile in Yii2

Wordpress add responsive srcset header image to theme

php echo xml documents with header

About Contact Privacy policy Terms and conditions