• 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

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

Show date difference as "20" instead of "20 years ago"

how to remove %20 in the url in php

Dynamic dropdown Ajax PHP request

How to validate Envato Purchase Code in PHP

How to increase the PHP upload limits [duplicate]

How to get Laravel's CSRF Token from Another Website?

MySQL default time format UTC or GMT?

How to submit the custom form data in database in WordPress without plugin using ajax?

Using array_intersect on a multi-dimensional array

What is my SQL missing?

Unable to match results of php hash_hmac() and coldfusion hmac()

Show Custom Data in Woocommerce Order Details Admin Area

Why is this PHP array not the same?

Check if string contains a value in array [duplicate]

About Contact Privacy policy Terms and conditions