• 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

Don't show recurring price for WooCommerce subscriptions worth 0$

GA4 custom event from server side, can someone tell me how i can do the following code in php?

Unable to uninstall brew php from homebrew

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

advanced custom fields wordpress custom class

Laravel 8: Array to string conversion while calling route:list

Shortcode or PHP inside a shortcode in Wordpress

Autoloading classes in PHPUnit using Composer and autoload.php

Multiply each value in array using array_map function

Implode array with array of glue strings

PHP array stringify

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

Distribute array row data to make multiple new rows

Cut an arabic string

About Contact Privacy policy Terms and conditions