• 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 redirect to another page after n seconds in wordpress without using javascript?

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Warning: A non-numeric value encountered

PHP header location absolute URL

Cut an arabic string

how to create html table in php

Store multiple fields in JSON column (Nova CMS)

PHP each() function replacement

What is the difference between client-side and server-side programming?

What is my SQL missing?

How Can I Do LIMIT 1, 2 In WP_Query

Invalid value in field "itemtype" in Google Search Console

How can I get data from PHP to Android TextView?

loop through an anchor id

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

About Contact Privacy policy Terms and conditions