From 6ec561c296ea69255298db88897e1b36daf57b01 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 6 Dec 2022 14:51:16 +0100 Subject: [PATCH] dirname(__FILE__)."/tmp/g1billet/". --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 78f909c..d53455c 100644 --- a/index.php +++ b/index.php @@ -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.");