• 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

enable Apache http Authorization header

PHP returning an error message and false

Unable to run composer install

Detect if PHP session exists

Get lat/lon from google maps url ftid (hex)

Assign output of PHP function to a variable

Component install error: JInstaller: :Install: File does not exist

PHP array stringify

How to reset Laravel AuthManager/guards in between API calls in tests?

Destroy session upon refresh

how to search for a file with php

Prestashop webservice API creating cart rules

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Shopify password update using Shopify API

How to test laravel controller method?

About Contact Privacy policy Terms and conditions