getMemoryLimit()) {//larger then the php memory limit, redirect to the file header('Location: ' . $path); exit; }else {//open it up and send out with php header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: ");// leave blank to avoid IE errors Header( "Content-type: ".@filetype($path)."\n"); header("Content-Transfer-Encoding: binary\n"); header("Content-Disposition: attachment; filename=\"" . basename($path). "\"\n"); header("Content-length:".$fileSize); $fp = @fopen($path); if($fp) { while($data = @fread($fp, 1000)) { echo $data; } fclose($fp); } } }else { die(ERR_DOWNLOAD_FILE_NOT_FOUND); } ?>