getFirst("MediaModel",array("id"=>$_GET['id'])); $id = $_GET["id"]; if (!is_null($pdfModel)){ $localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension; if (SFSManager::fileExists($localFilePath)){ $exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension; if (!SFSManager::fileExists($exposedFilePath)){ SystemController::shellExec("ln",'-nFs "'.$localFilePath.'" "'.$exposedFilePath.'"'); } header('X-Sendfile: '.$exposedFilePath.''); header("Content-type: application/octet-stream"); header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"'); } } } ?>