【发布时间】:2015-08-19 07:32:41
【问题描述】:
我有这个从服务器下载文件的 C# 代码:
public static void DownloadBinaryFile(byte[] _ByteArray, string fullfileName)
{
fullfileName = "רועי.pdf"; //"Royi.pdf" in hebrew
System.Web.HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fullfileName);
System.Web.HttpContext.Current.Response.BinaryWrite(_ByteArray);
System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream";
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.End();
}
注意文件名有一个固定值(用于测试)。
当我点击一个按钮时:
我确实在 FIDDLER 中看到了正确的名称:
Chrome 确实显示了要保存的正确文件名:
但是 Internet Explorer 显示乱码:
附加信息:
IE 11,Windows 7 64 位,边缘:
页面编码:
问题:
为什么文件名显示为乱码,我该如何解决?
【问题讨论】:
标签: c# asp.net http internet-explorer fiddler