作者previa (Southern Cross)
看板PHP
标题Re: [问题]有关 php使用中文档名存取
时间Mon Jul 3 09:02:38 2006
: 开一篇新的回好了
: 这个问题主要是
: ie在送出request的时候
: 会把网址转成unicode再做编码
: 所以才会出现你上面那种错误/正确的状况
: 该怎麽做才能解决这个问题?
: 很简单 不要让ie转码 你自己转
: <a href="正确的目录编码/01.rmvb">下载档案</a>
: 不知道这样你看不看的懂
: 希望对你有帮助
感谢大大热心的回文 我解决这个问题了 ^^
原来是我在处理下载的时候 把路径透过utf8_encode()函式来处理的关系
orz 搞了半天 .....
我最後还是送出unicode 因为我发现如果不指定用unicode送
遇到目录或档案有空白字元什麽的 就会只送出空白前的字串
最後成功了.
我在网路上有看到rawurlencode的说明
http://linux.tnc.edu.tw/techdoc/banic/url/rawurlencode.html
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=$filename");
readfile($redir);
真是好用阿~~ 长见识了
谢谢大大 orz
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.170.141.183