• 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

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

Correct way to use LIKE '%{$var}%' with prepared statements?

Laravel 8 Multiple Relationships for Factory

Dynamic table in HTML using MySQL and php

Lexik JWT authentication problem "Invalid credentials"

Prestashop cUrl Login

Popup Window and PHP form

php script to delete files older than 24 hrs, deletes all files

Passing a boolean value from checkbox in Laravel form

php file upload scanning using clamav, permissions on /tmp/

The sum of the user's points

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Require a class from another class - php

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

About Contact Privacy policy Terms and conditions