• 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

zsh: command not found: php

Unable to get password for the instance created from AMI

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

How to make Canonicals with PHP

How to remove from a multidimensional array all duplicate elements including the original?

How to set a domain name with php artisan serve

Implode array with array of glue strings

How to show a popup modal in codeIgniter?

Correctly determine if date string is a valid date in that format

Laravel no logout option from menu after successfull login

shell errors running php exec

merge all files in directory to one text file

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

PHP: Telegram Bot: Insert line break to text message

AJAX call fails with SyntaxError: Unexpected end of JSON input

About Contact Privacy policy Terms and conditions