Re: [請益] readfile 效率問題
小弟有遇到這種問題 一個 "新增文件.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
討論串 (同標題文章)
完整討論串 (本文為第 3 之 4 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章