• 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

Redirect to previous page with php

How to unlink image from folder?

Form repeater send wrong data with last element in Laravel

Converting alphabet letter to alphabet position in PHP [duplicate]

500 (Internal Server Error) with Laravel & Docker [duplicate]

Symfony/Form add attribute based on the data

How to convert binary string to normal string in php

Destroy session upon refresh

Display specific shipping method if woocommerce product has specific acf field value

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

php 7 php.ini upload_max_filesize not working

Get number of working days between two dates in PHP [duplicate]

PHP error: "The zip extension and unzip command are both missing, skipping."

hidden INPUT value not available in $_POST

About Contact Privacy policy Terms and conditions