• 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

Laravel 5 controller sending JSON integer as string

PHP: remove filename from path

Get number of working days between two dates in PHP [duplicate]

How to increase the PHP upload limits [duplicate]

Cant seem to get the Pagination to work on my WooCommerce REST API application?

Override default Auth routes in Laravel 7

dompdf and img tag, image wont show

PHP: Insert marker every 3 iterations

Check if a string contain multiple specific words

get data-value with variable value

How can I get data from PHP to Android TextView?

php retrieve specific data onclick from database in a list format

Performance of foreach, array_map with lambda and array_map with static function

CSS file not imported in laravel blade view

best way to store error messages in Laravel (session or variable)

About Contact Privacy policy Terms and conditions