如何让Firefox正确识别文件下载?

时间:2013-09-10 05:57:38

标签: asp.net firefox download

以下asp.net代码在Chrome& IE,但Firefox将文件显示为MyDownload.zip.htm,因此不知道如何处理它。

        //ASP.Net file download code
        Response.Clear();
        Response.AddHeader("content-disposition", "attachment;filename=MyDownload.zip");
        Response.TransmitFile(Server.MapPath("~/MyDownload.zip"));
        Response.Flush();

如何让Firefox正确识别附件?

1 个答案:

答案 0 :(得分:2)

添加MIME type标题:

Response.ContentType = "application/zip";