以下 header 在 IE 上有效但在 FF 上无效
<%@ Page Language="C#" ContentType="text/csv" Inherits="System.Web.Mvc.ViewPage"%>
<% Response.AddHeader("Content-Disposition", "filename=report.csv;attachment"); %>
在 FF 中,FF 中的建议名称显示为不带扩展名的“report”。
最佳答案
filename
只是Content-Dispostion的一个参数.所以你必须交换两者:
<% Response.AddHeader("Content-Disposition", "attachment;filename=report.csv"); %>
关于asp.net - 如何命名要在 Firefox 上下载的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1154033/