• 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

Split a string array into pieces

PHP mail function is sending blank message body

Creating Combinations of Elements

CSS file not imported in laravel blade view

How can i update or reset my password without entering email field in laravel-8?

Laravel 5.1 Unknown database type enum requested

How do I call a php file with axios?

How to convert binary string to normal string in php

codeigniter 4 running error first time with xampp

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

How to downgrade or install a specific version of Composer?

How in Laravel run JavaScript code stored in php variable?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

Symfony Mercure "Failed to send an update"

How to override htaccees file for cache control header

About Contact Privacy policy Terms and conditions