• 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 debug in WooCommerce 3+

Laravel Displaying image from database

500 Internal Server Error on Ajax request. Not sure the origin of the problem

PHP: set a (deep) array key from an array [closed]

Create a new line whenever an array value reaches more than 10 characters

Show rotation of tweets using current day of month

OAuth2 Token PHP

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Call to a member function fetch_field() on a non-object MySQLiDB

Hi, I am making a contact form thingy, and my php isn't working any reason why?

How to get page number on dompdf PDF when using "view"

How to disable only_full_group_by option in Laravel

PHP how to detect if running on arm64 cpu?

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

How to Make Laravel Eloquent "IN" Query?

About Contact Privacy policy Terms and conditions