在IE9中恢复HTTP下载

时间:2013-02-06 15:17:18

标签: asp.net asp.net-mvc http http-headers download

我真的很难在IE 9中恢复下载过程。在其他浏览器和下载管理器中,一切都很好用。 我知道要恢复下载所需的标题,但IE尝试恢复下载后不发送它们。 HTTP标头日志: 请求文件:

======================= Request ===========================
Connection=Keep-Alive
Accept=*/*
Accept-Encoding=gzip, deflate
Host=localhost
User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
======================= Response ===========================
Status code 200
Server=Microsoft-IIS/7.5
X-AspNetMvc-Version=3.0
Last-Modified=Thu, 07 Jun 2012 14:31:35 GMT
ETag="BCZFgJdhKko3IfS9D4nojw=="
Accept-Ranges=bytes
Expires=Sat, 10 Oct 2020 07:10:10 GMT
Content-Length=4048784811
Content-Disposition=attachment; filename=DEM_AK_Bristol Bay.zip
Cache-Control=private
X-AspNet-Version=4.0.30319
Content-Type=application/zip

这是恢复日志:

======================= Request ===========================
Connection=Keep-Alive
Accept=*/*
Accept-Encoding=gzip, deflate
Host=localhost
User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
======================= Response ===========================
Status code 200
Server=Microsoft-IIS/7.5
X-AspNetMvc-Version=3.0
Last-Modified=Thu, 07 Jun 2012 14:31:35 GMT
ETag="BCZFgJdhKko3IfS9D4nojw=="
Accept-Ranges=bytes
Expires=Sat, 10 Oct 2020 07:10:10 GMT
Content-Length=4048784811
Content-Disposition=attachment; filename=DEM_AK_Bristol Bay.zip
Cache-Control=private
X-AspNet-Version=4.0.30319
Content-Type=application/zip

正如您所看到的,他们绝对相同。 这是firefox的日志: 第一个请求:

======================= Request ===========================
Connection=keep-alive
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding=gzip, deflate
Accept-Language=ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
ASP.NET_SessionId=zv0ro2lhiumuijipzuamuemg
Host=localhost
User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
======================= Response ===========================
Status code 200
Server=Microsoft-IIS/7.5
X-AspNetMvc-Version=3.0
Last-Modified=Thu, 07 Jun 2012 14:31:35 GMT
ETag="BCZFgJdhKko3IfS9D4nojw=="
Accept-Ranges=bytes
Expires=Sat, 10 Oct 2020 07:10:10 GMT
Content-Length=4048784811
Content-Disposition=attachment; filename=DEM_AK_Bristol Bay.zip
Cache-Control=private
X-AspNet-Version=4.0.30319
Content-Type=application/zip

继续下载

======================= Request ===========================
Connection=keep-alive
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding=gzip, deflate
Accept-Language=ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
ASP.NET_SessionId=zv0ro2lhiumuijipzuamuemg
Host=localhost
<b>If-Match="BCZFgJdhKko3IfS9D4nojw=="
If-Unmodified-Since=Thu, 07 Jun 2012 14:31:35 GMT
Range=bytes=526057028-</b>
User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
======================= Response ===========================
Status code 206
Server=Microsoft-IIS/7.5
X-AspNetMvc-Version=3.0
Last-Modified=Thu, 07 Jun 2012 14:31:35 GMT
ETag="BCZFgJdhKko3IfS9D4nojw=="
Accept-Ranges=bytes
Expires=-1
Content-Length=3522727783
Content-Range=bytes 526057028-4048784810/4048784811
Cache-Control=no-cache
X-AspNet-Version=4.0.30319
Content-Type=application/zip
Pragma=no-cache

有谁知道会导致这个问题的原因?感谢。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案并且非常简单。缓存设置是我的应用程序“世界上最好的浏览器”认为该文件已从一开始就被修改和重新下载。这是非常奇怪的行为,因为其他浏览器和下载管理器都很好。