火狐版本是3.5.6
使用C#编写下载代码,VS2005首先是弹出一个模式窗口,其中有一个链接,点击后将调用代码进行下载,代码如下: LinkButton lb = sender as LinkButton;
string filePath = lb.CommandArgument + lb.Text;
string fileName = Path.GetFileName(filePath);
Response.Clear();
Response.ContentType = "application/octet-stream"; if (File.Exists(filePath))
{
string BrowserType = Page.Request.Browser.Browser;
if (string.Equals(BrowserType, "Firefox"))
{
//FF
Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
}
else
{
//IE
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Context.Server.UrlPathEncode(fileName)); Response.ContentEncoding = System.Text.Encoding.UTF8;
}
try
{
Response.TransmitFile(filePath);
}
catch (Exception ex)
{
throw;
}
Response.Flush();
Response.End();
}
IE下载是好的,火狐一般窗口下载也是好的,就是到了这个模式窗口就下载不了,会弹出火狐的下载窗口,窗口中的内容为: 您已选择打开
为:
来源:
您想要Firefox如何处理此文件?
<单选按钮选中> 打开文件(O)
<单选按钮>保存文件(S)
<复选框>以后自动采用相同的动作处理此类文件。(A)
<下拉框>关键是您已选择打开 为:,和 来源: 后面什么也没有是代码问题还是火狐需要做相应的设置,请帮忙看看,谢谢!!
使用C#编写下载代码,VS2005首先是弹出一个模式窗口,其中有一个链接,点击后将调用代码进行下载,代码如下: LinkButton lb = sender as LinkButton;
string filePath = lb.CommandArgument + lb.Text;
string fileName = Path.GetFileName(filePath);
Response.Clear();
Response.ContentType = "application/octet-stream"; if (File.Exists(filePath))
{
string BrowserType = Page.Request.Browser.Browser;
if (string.Equals(BrowserType, "Firefox"))
{
//FF
Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
}
else
{
//IE
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Context.Server.UrlPathEncode(fileName)); Response.ContentEncoding = System.Text.Encoding.UTF8;
}
try
{
Response.TransmitFile(filePath);
}
catch (Exception ex)
{
throw;
}
Response.Flush();
Response.End();
}
IE下载是好的,火狐一般窗口下载也是好的,就是到了这个模式窗口就下载不了,会弹出火狐的下载窗口,窗口中的内容为: 您已选择打开
为:
来源:
您想要Firefox如何处理此文件?
<单选按钮选中> 打开文件(O)
<单选按钮>保存文件(S)
<复选框>以后自动采用相同的动作处理此类文件。(A)
<下拉框>关键是您已选择打开 为:,和 来源: 后面什么也没有是代码问题还是火狐需要做相应的设置,请帮忙看看,谢谢!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货