• 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

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

Unable to match results of php hash_hmac() and coldfusion hmac()

How to properly start Laravel 8 with Bootstrap & authentication

Doctrine 2 mapping referencing unique key

PHP: Telegram Bot: Insert line break to text message

XSS attack still works despite htmlspecialchars() doing its work

nginx err_connection_refused, can anyone help me?

Using spatie/media-library, how to rename a collection of uploaded files?

Timber: Single post pagination does not work (wp_link_pages)

How do I call a php file with axios?

laravel automatically deletes server.php on php artisan serve

PHP function Not Working As Expected From functions.php Include File

Laravel: HTML in notification

How to send image,audio or video through the WhatsApp API - PHP

Xdebug in Laravel is not working with VSCode

About Contact Privacy policy Terms and conditions