• 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

MySQL order by field in Eloquent

Read users and passwords from a txt file

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

PHP - Store information with NO database

Laravel dosen't connect with Oracle

PHP usort() order in case of equality

How to pass data to all views in Laravel 5?

How do I set the maximum php memory limit

PHP 8 - libxml_disable_entity_loader() has been deprecated. How do I replace the functionality it provides?

Vimeo API: how to save a vimeo into a subfolder?

Python - Include another Python script

How to override header set in Apache config with more specific header in a virtual host

Insert database rows from columns of data from associative array of indexed arrays

Printing more than one array using print_r or any other function in php

How avoid Moved Permanently The document has moved here

About Contact Privacy policy Terms and conditions