• 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

selected value from the listbox in php

How update php.ini on a Mac OS X Mojave?

How to fix bootstrap multiselect search data using ajax

Yii Ajax Submit button

Normalize DateInterval in PHP

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

Get all WooCommerce products within own plugin

Add restriction to WooCommerce coupons by allowed user ID

Laravel query builder binding parameters more than once

json_encode turns array into an object

Get latest Tweets - What API

Update Order custom Field value with WooCommerce REST API

Error converting docx to pdf using Unoconv

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Symfony redirect if already loggedin from login page

About Contact Privacy policy Terms and conditions