• 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

how to identify the web server name of remote host

WooCommerce Subscriptions: Remove role on cancelled subscription

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

Substitute integers and dots with regex [duplicate]

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

How to get total pages of PDF with FPDF?

Change user role if checkout custom checkbox is checked in WooCommerce

Coinpayments create_transaction "ERROR: Invalid command!"

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

How do I call a php file with axios?

How to downgrade or install a specific version of Composer?

ConstraintViolationListInterface to Exception in Symfony

Symfony autowiring issues since docker update

selected value from the listbox in php

find in set in laravel ? example

About Contact Privacy policy Terms and conditions