• 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

WAMP Virtual Host not working

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

XML to CSV with PHP converter [problem with images grabing]

Match single unknown parameter php (Morse-code Regex)

How to get AJAX to post on second page?

Getting output of MS stored procedure on php call

How to convert binary string to normal string in php

correct PHP headers for pdf file download

Problems getting instance of UploadedFile in Yii2

Symfony run hint kernel.secret parameter not found

Why rand() every time I refresh the page?

Call authenticate manually in router middleware

wordpress : How to specify the cause "This site can’t be reached"

if statement inside concatenation

Sort multidimensional array by column value within a column

About Contact Privacy policy Terms and conditions