C# MVC 火狐下载文件时,弹窗中的文件名为乱码,但是IE不乱码。
代码如下:
public ActionResult DownloadFile(Guid id)
{
try
{
Document document = DocumentDao.GetDocumentById(id);
string path = string.Format("{0}/{1}", Server.MapPath("/Documents"), document.ArchiveIdentity);
return File(path, "application/octet-stream", Url.Content(document.FileName));
}
catch {
return null;
}
}
代码如下:
public ActionResult DownloadFile(Guid id)
{
try
{
Document document = DocumentDao.GetDocumentById(id);
string path = string.Format("{0}/{1}", Server.MapPath("/Documents"), document.ArchiveIdentity);
return File(path, "application/octet-stream", Url.Content(document.FileName));
}
catch {
return null;
}
}
解决方案 »
- VS2008 C# 生成静态页[近来问题比较多!!]
- 关于 DevComponents.DotNetBar.dll 的 控件 教程!!!!
- 引用COM组件后,程序不能签名?
- 求一个 格式化的问题
- 请帮忙给看看这是什么问题啊,网页不能浏览,之前还好好的,真奇怪,在线等.........
- 在网页中怎样打印网页中的一部分(比如打印网页中的一个表格)
- c# winform 中如何获取窗体上所有的控件包括容器里的控件
- C#开发datagridview中
- Socket 一个数据包应该怎样表示
- 一个弱弱的问题,高手请进!
- 我定义了一个常量,然后把这个常量用在初始化数组中的表示其大小,可以吗?
- C# WinForm调整groupBox和dataGridView的尺寸问题
通过Request\.UserAgent区别不同的浏览器
完全不知道为什么,求解~~~
http://stackoverflow.com/questions/5826649/returning-a-file-to-view-download-in-mvc
进行更多的控制