• 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

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

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

Getting values for an enum?

PHP header location absolute URL

Laravel 5 issue with wherePivot

HTML and PHP in one file

Star and Half Star Rating in Laravel

How to submit a form when page loads using JavaScript?

Get image type from base64 encoded src string

Laravel print last executed SQL query with Query log

XML to CSV with PHP converter [problem with images grabing]

Woocommerce product attributes with hierarchy like categories

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

how to search for a file with php

About Contact Privacy policy Terms and conditions