readfile下载文件加ob_clean作用
手册中readfile例子
$file = '12.jpg';<br /><br />if(file_exists($file)){<br /> <br /> header('Content-Description: File Transfer');<br /> header('Content-type: application/octet-stream');<br /> header('Content-Disposition: attachment; filename=' . basename($file));<br /> header('Content-Transfer-Encoding: binary');<br /> header('Expires: 0');<br /> header('Cache-control: must-revalidate');<br /> header('Pragma: public');<br /> header('Content-Length: ' . filesize($file));<br /> ob_clean();<br /> flush();<br /> readfile($file);<br /> exit();<br />}