• 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

Clear javascript source cache laravel 5.8

Laravel - Browser displays message again when I press back button

Make survey at laravel 5.4 and MySQL

Convert PHP array into HTML tag attributes separated by spaces

Increase value by 1 on button click

OctoberCMS / Anonymous Global Scope

Getting output of MS stored procedure on php call

How can I get user id from session in javascript?

how to fix Service provider class not found when using repository?

Use same method for inertia response and json response Laravel Jetstream

javascript html popup window

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

Display Link Title Instead of URL in XSL

Access relation of pivot table in Laravel

Laravel 8: Array to string conversion while calling route:list

About Contact Privacy policy Terms and conditions