• 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

No result using makeStyles Material UI in react 18

Cut an arabic string

PHP Print to Network Printer

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

How to execute sql code based on fetch array

Return new collection without modifying original collection

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

"There is no active transaction" when refreshing database in Laravel 8.0 test

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

Override default Auth routes in Laravel 7

How to create a scheduler application in php

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

How can I format this number correctly using PHP?

Android Volley getParams() method not getting called for JsonObjectRequest

Boolean assignment operators in PHP

About Contact Privacy policy Terms and conditions