Added missing code 4 PDFs

This commit is contained in:
katagia 2003-09-28 16:41:00 +00:00
parent fd15b03eb1
commit 5f7164c7c8
1 changed files with 25 additions and 0 deletions

25
lam/templates/getpdf.php Normal file
View File

@ -0,0 +1,25 @@
<?php
$f=$HTTP_GET_VARS['f'];
//Check file (don't skip it!)
//print $f;
//if(substr($f,0,3)!='tmp' or strpos($f,'/') or strpos($f,'\\'))
// die('Incorrect file name');
if(!file_exists($f))
die('File does not exist');
//Handle special IE request if needed
if($HTTP_SERVER_VARS['HTTP_USER_AGENT']=='contype')
{
Header('Content-Type: application/pdf');
exit;
}
//Output PDF
Header('Content-Type: application/pdf');
Header('Content-Length: '.filesize($f));
readfile($f);
// Give Browserplugin some time to get file
sleep(240);
//Remove file
unlink($f);
exit;
?>