• 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

How to get quarter for future date using Carbon?

PHPExcel export HTML table to xlsx

How do I call Validator from a namespace with an already existing Validator class

Using spatie/media-library, how to rename a collection of uploaded files?

PHP-Sort array based on another array?

how to validate form data in codeigniter 4

How to extract price from given url using Xpath?

SQLSTATE[HY000]: General error: 1 table posts has no column named *

Sum array values of a column within each column of an array with 3 levels

How to reset Laravel AuthManager/guards in between API calls in tests?

Redis Command To Sort Keys

Send POST data via raw JSON with Postman

"cannot list resources" error from WooCommerce REST API

How to make dot match newline characters using regular expressions

Inserting data into SQL Server Db An Invalid direction was specified

About Contact Privacy policy Terms and conditions