Return to Snippet

Revision: 4773
at January 20, 2008 21:52 by coggla


Initial Code
$file = $_GET["file"];
$download = "http://www.ssn.flinders.edu.au/".$file;

if(ini_get('zlib.output_compression')) { 
   ini_set('zlib.output_compression', 'Off'); 
 }

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=".basename($download).";" );
readfile("$download");

Initial URL

                                

Initial Description

                                

Initial Title
Force a file download

Initial Tags
file, download

Initial Language
PHP