• 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 block shortcut in Visual Studio Code

Install mysql client in docker image

merge all files in directory to one text file

How do I call a php file with axios?

Laravel csrf token mismatch for ajax POST Request

(Laravel) How to delete multiple models including optional relationships?

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

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

Correctly determine if date string is a valid date in that format

auth pages not getting css in laravel

Laravel Route issues with Route order in web.php

Check If array is null or not in php

Can't exclude directories from .htaccess mobile redirect?

str_word_count() function doesn't display Arabic language properly

WooCommerce - unset "<product> removed notice…" on cart page

About Contact Privacy policy Terms and conditions