• 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

Laravel 5 controller sending JSON integer as string

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

How to unlink image from folder?

CSV to PHP class properties

Read users and passwords from a txt file

generate an Excel file using PHP

PHP: Print caught exception like Xdebug

laravel sanctum Route [login] not defined

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

Set quantity minimum, maximum and step at product level in Woocommerce

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

(Cache::lock()) -> get() -- Under what conditions does it return false?

Live search query using JS and PHP for QA forum

how to see if database exists with PDO [duplicate]

Xdebug 3 not showing in phpinfo on m1 Monterey

About Contact Privacy policy Terms and conditions