• 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

Reorder attribute dropdown terms in Woocommerce single variable products

How to get the total hour from starting time to end time in php

WAMP Virtual Host not working

How do I call Validator from a namespace with an already existing Validator class

Server-sent events in PHP (without echo or print)

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

Python - Include another Python script

PHP Discord OAUTH2 code sample not working

how to remove white space in select 2

How to convert binary string to normal string in php

How to test laravel controller method?

Add custom text under order details on WooCommerce My account view order pages

Fetch files from next cloud storage and display in Laravel website

Read users and passwords from a txt file

PHP SoapClient: set a namespace without prefix

About Contact Privacy policy Terms and conditions