因為每一個版本的狀況不同 ...
目前這樣測試都可以成功的把中文檔案下載下來..
string targetPath = Server.MapPath("/filesrc/") + File_Name;
string tmp_filename = File_Name;
if (Request.Browser.Browser == "IE"|| Request.Browser.Browser == "Opera")
{
tmp_filename = Server.UrlPathEncode(tmp_filename);
}else if (Request.Browser.Browser == "Safari" ){
string strContentDisposition = String.Format("{0}; filename=\"{1}\"", "attachment", tmp_filename);
Response.AddHeader("Content-Disposition", strContentDisposition);
}
return File(targetPath, File_ContentType, tmp_filename);
瀏灠器測試版本
IE 9 及其各種相容性檢示
Chrome 22.0.1229.79 m
Firefox 15.0.1
Opera 12.02
Safari 5.1.7(7534.57.2)