From fceccff58346dc154b3d6069458ef5a1ffacdf7d Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Thu, 8 Sep 2016 13:49:08 +0200 Subject: [PATCH] Get pdf non riusciva ad esporre i PDF tramite xSendFile dato che non creava la cartella xsendfile se non esisteva --- public/getPDF.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/getPDF.php b/public/getPDF.php index b4ed888..17e780f 100644 --- a/public/getPDF.php +++ b/public/getPDF.php @@ -14,6 +14,9 @@ if (array_key_exists("id",$_GET)) { if (SFSManager::fileExists($localFilePath)){ $exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension; if (!SFSManager::fileExists($exposedFilePath)){ + if (!SFSManager::fileExists(GlobalVariables::get("config")->paths->xsendfile) || !is_dir(GlobalVariables::get("config")->paths->xsendfile)){ + SystemController::mkdir(GlobalVariables::get("config")->paths->xsendfile); + } SystemController::shellExec("ln",'-nFs "'.$localFilePath.'" "'.$exposedFilePath.'"'); } header('X-Sendfile: '.$exposedFilePath.'');