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.'');