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