gpt4 book ai didi

asp.net - 如何命名要在 Firefox 上下载的文件?

转载 作者:可可西里 更新时间:2023-11-01 16:24:13 25 4
gpt4 key购买 nike

以下 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com