PHP utf-8 用 header 檔案下載 word error
以前在 big5 網頁用
header("Content-Type: application/force-download; name=\"".$file."\""); //==> 當你存檔的時候正確顯示你的檔名
header("Content-Disposition: attachment; filename=\"".$file."\""); //==> 當你存檔的時候正確顯示你的檔名
header("Content-Transfer-Encoding: binary");
readfile($df);
可以下載 word 或 pdf 的檔案
可是改成 utf-8 網頁時,下載 word 檔案就顯示無法啟動轉換程式,在網頁上找到有人說是 buffer 的問題,後來看到有人加入清 buffer 的函數,竟然就可以了,將指令修改如下
header("Content-Type: application/force-download; name=\"".$file."\""); //==> 當你存檔的時候正確顯示你的檔名
header("Content-Disposition: attachment; filename=\"".$file."\""); //==> 當你存檔的時候正確顯示你的檔名
header("Content-Transfer-Encoding: binary");
ob_clean();
flush();
readfile($df);
迴響
PHP utf-8 用 header 檔案下載 word error | 豬窩
Hey! This is my first comment here so I just wanted to give a quick
shout out and tell you I truly enjoy reading through your
articles. Can you suggest any other blogs/websites/forums that cover the same
topics? Thank you so much!
PHP utf-8 用 header 檔案下載 word error | 豬窩
Cbd oil that works 2020
Way cool! Some very valid points! I appreciate you penning this
article plus the rest of the website is really good. best rated
cbd oil http://j.mp/3drY6lE cbd oil that works 2020 http://j.mp/3drY6lE
PHP utf-8 用 header 檔案下載 word error | 豬窩
Amazing! Its in fact awesome article, I have got much clear idea on the topic of from this paragraph.
PHP utf-8 用 header 檔案下載 word error | 豬窩
You made some good points there. I checked on the
net to learn more about the issue and found most people
will go along with your views on this website.
PHP utf-8 用 header 檔案下載 word error | 豬窩
I read this paragraph fully concerning the
resemblance of most recent and previous technologies, it's amazing article.