first commit
This commit is contained in:
34
praxisstelle/downpdf.php
Executable file
34
praxisstelle/downpdf.php
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require_once("../config.inc.php");
|
||||
if($_SESSION["prx_dst_id"] == ''){
|
||||
echo"<script type='text/javascript'>window.top.location.href = \"index.php\";</script>";
|
||||
exit;
|
||||
}
|
||||
$file = urldecode($_GET["file"]);
|
||||
#$file = str_replace('%28', '(', $file);
|
||||
#$file = str_replace('%29', ')', $file);
|
||||
#$file = str_replace('%2C', ',', $file);
|
||||
#$file = str_replace('%3B', ';', $file);
|
||||
#$file = str_replace('%3B', ';', $file);
|
||||
#$file = str_replace('%E2%80%93', '–', $file);
|
||||
|
||||
if (file_exists($file)) {
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=" . urlencode(basename($file)));
|
||||
header("Content-Type: application/download");
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Length: " . filesize($file));
|
||||
|
||||
flush(); // This doesn't really matter.
|
||||
|
||||
$fp = fopen($file, "r");
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 65536);
|
||||
flush(); // This is essential for large downloads
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
}else{
|
||||
echo "Datei nicht gefunden";
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user