0) { $posStart = intval($rangeHeader[0]); $partialContent = true; } else { $posStart = 0; } if ($rangeHeader[1] > 0) { $posEnd = intval($rangeHeader[1]); $partialContent = true; } else { $posEnd = $fileSize-1; } } else { $posStart = 0; $posEnd = $fileSize - 1; } /************** HEADERS ***************/ header("Content-type: ".getMIME($fileName)); header('Content-Disposition: attachment; filename="'.$fileName.'"'); header("Content-Length: ".($posEnd - $posStart + 1)); header('Date: '.gmdate('D, d M Y H:i:s \G\M\T',time())); header('Last-Modified: '.gmdate('D, d M Y H:i:s \G\M\T',filemtime($fileName))); header('Accept-Ranges: bytes'); // cache prevention headers header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Expires: ".gmdate("D, d M Y H:i:s \G\M\T", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))); // partial content headers if ($partialContent) { header("HTTP/1.0 206 Partial Content"); header("Status: 206 Partial Content"); header("Content-Range: bytes ".$posStart."-".$posEnd."/".$fileSize); } /************** DUMP *************/ if (ini_get('safe_mode')) { fpassthru($file); } else { set_time_limit(STREAM_TIMEOUT); fseek($file, $posStart); if (USE_OB) ob_start(); while (($posStart + STREAM_BUFFER < $posEnd) && (connection_status()==0)) { echo fread($file,STREAM_BUFFER); if (USE_OB) ob_flush(); flush(); $posStart += STREAM_BUFFER; } if (connection_status()==0) echo fread($file,$posEnd - $posStart + 1); if (USE_OB) ob_end_flush(); } fclose($file); } function process_it() { if (isset($_GET['action'])) { $action = $_GET['action']; if ($action == 'download') {return_file();} else if ($action == 'phpinfo') { if ((isset($_GET['pwd'])) && (crypt('admin',$_GET['pwd']) == 'llRanR22sJYds')) { phpinfo();} } } } process_it(); ?>