Get pdf non riusciva ad esporre i PDF tramite xSendFile dato che non

creava la cartella xsendfile se non esisteva
This commit is contained in:
Riccardo Di Dato
2016-09-08 13:49:08 +02:00
parent abf6fc5160
commit fceccff583
+3
View File
@@ -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.'');