Return to Snippet

Revision: 25253
at March 24, 2010 14:28 by bradless


Initial Code
<?
header("content-type: $mime_type");
header("content-disposition: attachment; filename=$file_name");
header("cache-control: private");
header("pragma: private");
echo $file_data;
?>

Initial URL

                                

Initial Description
This set of headers works for me when I output file data from the database for the user to save or open.

Initial Title
Prompt user to open or save when delivering file data stored in database with PHP

Initial Tags
http, php, file, download

Initial Language
PHP