• 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

Laravel 5.5 change unauthenticated login redirect url

How Can I Do LIMIT 1, 2 In WP_Query

PHP Form Not Inserting

How to send image,audio or video through the WhatsApp API - PHP

Transpose csv file data [duplicate]

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

How to redirect to another page after n seconds in wordpress without using javascript?

How to get total pages of PDF with FPDF?

Combining a describing and one array with data

SQL to convert multiple rows into a single row of variable length

laravel controller function parameters

WordPress - Dynamically add user ID to the end of a URL

Laravel You requested 1 items, but there are only 0 items available

PHP mail sending empty mails

PHP each() function replacement

About Contact Privacy policy Terms and conditions