• 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

Require a class from another class - php

Attempt to read property "view" on null when sending password reset email

How can i update or reset my password without entering email field in laravel-8?

Adding custom body class to the custom archive pages

Laravel: Create morphs() relationship nullable

Pass a select with mysqli_fetch_row to a table

How to update array value in Laravel

Sentry on Symfony: how to exclude `NotFoundHttpException`

SlimExceptionHttpNotFoundException

Woocommerce Checkout - Add conditional field required if one field is filled

Installing Composer - Internal Error

I need to link Google Sheet with my Laravel

Laravel Sanctum CSRF not authenticating

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

No definition found for function in vendor vscode

About Contact Privacy policy Terms and conditions