【问题标题】:Resuming HTTP download in IE9在 IE9 中恢复 HTTP 下载
【发布时间】:2013-02-06 15:17:17
【问题描述】:

我真的被 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

有谁知道什么会导致这个问题?谢谢。

【问题讨论】:

  • 您的 Content-Disposition 标头字段已损坏(但这可能与您的问题无关)。
  • 感谢您的回复,但我的 Content-Disposition 标头有什么问题?
  • 文件名没有被引用,但包含空格。请参阅 RFC 6266。

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-14
    • 1970-01-01
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    • 2020-11-04
    相关资源
    最近更新 更多