如何命名下载的Firefox的文件? [英] How to name a file for download on Firefox?

查看:152
本文介绍了如何命名下载的Firefox的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的标题在IE上工作,但不能在FF

The following headers work on IE but not on FF

<%@ Page Language="C#" ContentType="text/csv" Inherits="System.Web.Mvc.ViewPage"%>
<% Response.AddHeader("Content-Disposition", "filename=report.csv;attachment"); %>

在FF FF中建议的名称显示为报告不带扩展名。

In FF the suggested name in FF appears as "report" without the extension.

推荐答案

我目前使用code,看起来像这样:

I am currently using code that looks like this:

response.AddHeader("Content-Disposition", "attachment; filename=\"data.csv\"");

在我的日常工作​​ - 这工作得很好。另外你确定这是不是你的操作系统或任何具有了隐藏已知文件类型的扩展名启用-option? (我知道Windows系统有这个选项,它使我疯了)

In my daily work - and that works just fine. Also are you sure this is not your OS or anything that has the "Hide extensions for known file types"-option enabled? (I know Windows have this option and it drives me crazy)

这篇关于如何命名下载的Firefox的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆