• 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

Sort a multidimensional array by integer inside of a string value which is two levels down

Detect emoticons in string

how to validate form data in codeigniter 4

Form Validation and Submission to database

Laravel Pagination links() not working

Match csv filenames to table names and import

Laravel dosen't connect with Oracle

PHPExcel How to set conditional formatting to change cell background color based on cells values

Converting alphabet letter to alphabet position in PHP [duplicate]

How to add class name to an existing tag in php

Explode not working properly with dash

Webscraping Symfony/Panther: Can't get HTML

Split a string array into pieces

generating a random code in php?

PHP - installing Xdebug on Mac with XAMPP (Unix File)

About Contact Privacy policy Terms and conditions