• 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

Detect emoticons in string

PHP array sort and remove duplicates by two field values

I cannot create a auto generated date time in mysql workbench

Reload parent page after submit in iframe

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

How can I format this number correctly using PHP?

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Laravel set default language not working

Laravel 5.5 change unauthenticated login redirect url

Currently Using CodeIgniter Framework i have an Error

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Apply session id from request header

Can I use a WooCommerce function without any WooCommerce page?

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

Move a child array to parent array and change parent/child name

About Contact Privacy policy Terms and conditions