IE 10 - 文件下载问题 [英] IE 10 - File download issues

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

问题描述

我想下载一个Excel文件(使用C#\\ ASP.NET动态生成的),我得到当我点击打开查看IE10下载对话框提示abc.xls无法下载错误,但之后点击重试得当打开.xls文件在第二次尝试。

I'm trying to download an excel file (generated dynamically using C#\ASP.NET) and I get the IE10 View Downloads dialog when I click "Open" it says "abc.xls couldn't be downloaded" error but after clicking "Retry" it opens the .xls file properly in the second try.

当我在Firefox或Chrome测试这个正常工作。

When I test this in Firefox or Chrome it works fine.

推荐答案

我想,这也许可以解释的奇怪的行为:

I think this may explain the strange behaviour:

<一个href=\"http://blogs.msdn.com/b/ieinternals/archive/2012/07/16/content-length-and-transfer-encoding-validation-in-ie10-download-manager-couldnt-be-downloaded-retry-cancel.aspx\">\"Content-Length和传输编码验证在IE10下载管理器

看来,IE9测试版已经推出了内容长度传输编码验证下载文件时,却发现这是问题太多,因为很多服务器并没有为这些下载那些通过code处理发送正确的价值观。显然,他们在IE10把它重新但是,只是最好的希望。

It seems that IE9 beta had introduced content-length and transfer-encoding validation when downloading files, but found it was too problematic since many servers didn't send proper values for these downloads that are processed through code. Apparently they turned it back on in IE10 however and just hoped for the best.

我打赌当下载启动应该搞清楚这个问题被发送准确值。当然,它不应该已经开始与... AI衣衣有问题。

原来,这个问题是有关(至少对我来说),使用 Response.Close()和/或到Response.End ()在code <一个href=\"http://blogs.msdn.com/b/aspnetue/archive/2010/05/25/response-end-response-close-and-how-customer-feedback-helps-us-improve-msdn-documentation.aspx\">This文章 解释了为什么你不应该使用这2种方法,为什么 HttpApplication.CompleteRequest 是首选的方法。改变我们的到Response.End() Response.Close() HttpApplication.CompleteRequest实例解决了我们IE10下载问题。像变魔术一样。显然,现在MSDN鼓励使用这2种方法(尽管经过多年的含有这些MSDN code的例子),而现在提倡使用 HttpApplication.CompleteRequest 代替。

Turns out this problem was related (for me at least) with using Response.Close() and/or Response.End() in code. This article explains why you shouldn't use these 2 methods, and why HttpApplication.CompleteRequest is the method of choice. Changing our Response.End() and Response.Close() instances to HttpApplication.CompleteRequest solved our IE10 download issues. Like magic. Apparently MSDN now discourages use of these 2 methods (despite years of MSDN code examples containing them), and now advocates use of HttpApplication.CompleteRequest instead.

我们总是在与欧亚大陆的战争...

We were always at war with Eurasia...

[/编辑]

这篇关于IE 10 - 文件下载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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