• 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 Route issues with Route order in web.php

php script to delete files older than 24 hrs, deletes all files

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

nginx err_connection_refused, can anyone help me?

Composer Script echo

Get data from accuweather api url

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

Get orders by date and status woocommerce

XSS attack still works despite htmlspecialchars() doing its work

Issue saving card for customer

PHP header location absolute URL

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

How to install php yaml on CentOs?

renameColumn migration fails for existing column with columns does not exist error

About Contact Privacy policy Terms and conditions