<?php
sleep(2);
$f=$HTTP_GET_VARS['f'];
//Check file (don't skip it!)
/*if(substr($f,0,3)!='pdf' or strpos($f,'/') or strpos($f,'\\'))
    die('Incorrect file name');
	*/
if(!file_exists($f)) {
    die("Archivo no existe $f. Vuelva a generar el informe");
}
//Handle special IE request if needed
if($HTTP_SERVER_VARS['HTTP_USER_AGENT']=='contype')
{
    header('Content-Type: application/pdf');
	header('Content-Disposition: filename="informe.pdf"');
    exit;
}
//Output PDF
header('Content-Type: application/pdf');
header('Content-Disposition: filename="informe.pdf"');
header('Content-Length: '.filesize($f));
readfile($f);
//Remove file
//@unlink($f);
exit;
?>
