dirname(__FILE__)."/tmp/g1billet/".

This commit is contained in:
fred 2022-12-06 14:51:16 +01:00
parent 35f933d208
commit 6ec561c296
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ if ( $_REQUEST['style'] == 'ticket' || $_REQUEST['style'] == 'xbian' || $_REQUES
} else {
$file_type = "pdf";
}
$attachment_location = "/tmp/g1billet/".$timestamp.".".$file_type;
$attachment_location = dirname(__FILE__)."/tmp/g1billet/".$timestamp.".".$file_type;
if (file_exists($attachment_location)) {
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
@ -20,7 +20,7 @@ if (file_exists($attachment_location)) {
header("Content-Length:".filesize($attachment_location));
header("Content-Disposition: attachment; filename=".$timestamp.".".$file_type);
readfile($attachment_location);
unlink("/tmp/g1billet/".$timestamp.".".$file_type);
unlink(dirname(__FILE__)."/tmp/g1billet/".$timestamp.".".$file_type);
die();
} else {
die("Error: File not found.");