2012年7月12日 星期四

{C#} 文件下載-Response.AddHeader

Response.AddHeader("Content-Disposition", attachment;filename全名(含附檔));


參考資料:
中文檔名問題
1.Response.HeaderEncoding = System.Text.Encoding.GetEncoding("big5");
http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/09/05/kb-open-and-download-file-in-chinese-filename.aspx

2.Server.UrlEncode(fileName)
http://blog.miniasp.com/post/2008/04/20/ASPNET-Force-Download-File-and-deal-with-Chinese-Filename-correctly.aspx

http://www.pctartarus.com/bbs/thread-982-1-1.html

Response 物件解說
http://www.study-area.org/coobila/tutorial_336.html

使用方式完整版
http://stackoverflow.com/questions/3889521/response-addheadercontent-disposition-not-opening-file-in-ie6