作者previa (Southern Cross)
看板PHP
標題Re: [請益] readfile 效率問題
時間Mon Jul 17 21:58:47 2006
小弟有遇到這種問題 一個 "新增文件.txt"的內容只有123
ob_end_clean();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment;filename=\"$filename\"");
header("Content-Length: $file_size");
header("Content-Transfer-Encoding: binary");
ob_end_clean();
readfile($redir);
ob_end_flush();
如果不加這三行 我下載下來的內容會是
(換行)
123
(換行)
就是多了兩個換行符號 我至今仍然不知道為什麼會這樣orz
只知道try很久
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.140.49.113