public function downloadAction() { ini_set("zlib.output_compression", "off"); ob_clean(); ob_get_clean(); $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $id = $this->_getParam("id"); if ($_SERVER["Repository_Enabled"] !== 'true' || is_numeric($id) == false || $_SERVER['REQUEST_METHOD'] != "GET") { header("Status: 404 Not Found"); return; } $mime = "application/octet-stream"; $url = RepositoryFS::getPackageDatabankUrl($id, $mime); if ($url === false || file_exists($url) === false) { header("Status: 404 Not Found"); return; } $filename = basename($url); ob_start(); ob_get_clean(); header('Content-Description: File Transfer'); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Expires: 0"); header("Content-type: " . $mime); header("Content-length: " . filesize($url)); header("Content-Transfer-Encoding: binary"); header("Content-disposition: attachement;filename=\"" . urlencode($filename) . "\""); ob_clean(); flush(); $file = @fopen($url, 'rb'); if ($file) { @fpassthru($file); } exit; }