• 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 websockets AWS EC2 - Connection failed

Submitting a form with ajax in Wordpress

Normalize DateInterval in PHP

Woocommerce Checkout - Add conditional field required if one field is filled

Mysqli multi query error

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

ldap is missing from system when installing adldap2 in laravel

How avoid Moved Permanently The document has moved here

SQLSTATE[HY000]: General error: 1 table posts has no column named *

laravel sanctum Route [login] not defined

OctoberCMS / Anonymous Global Scope

Laravel passport auth token not working after moving to different server

merge all files in directory to one text file

Multiple order by in WooCommerce

Log a user out of a website when they put their computer to sleep

About Contact Privacy policy Terms and conditions