GAE Blobstore问题 - 在Internet Explorer 8下载失败 [英] GAE Blobstore issue - download fails in internet explorer 8
问题描述
我有一个使用send_blob函数向Internet Explorer提供文件的问题。文件从0.5Mb到5Mb很小。所有在Firefox和Chrome中运行良好,但在IE 8.0中,我得到下载进度窗口,并在几秒钟后出现错误:
无法从[域名在这里]
无法打开这个互联网网站,请求的网站不可用或无法找到,请稍后重试
当尝试通过HTTPS下载二进制文件时,此问题是由IE中的错误引起的。该错误与HTTP响应中的Cache-Control标头相关。
在这里您可以找到更多信息:
http://support.microsoft.com/kb/323308
只需使用HTTP而不是HTTPS或通过将处理程序中的Cache-Control设置为与no-cache不同的方式,就可以解决问题。以下代码适用于我: I have an issue with serving files to internet explorer using send_blob function. Files are quite small from 0.5Mb to 5Mb. All works fine in Firefox and Chrome, but in IE 8.0 I get download progress window and after couple of seconds error: "Unable to download [blob key here] from [domain name here] Unable to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later" This issue is caused by a bug in IE when trying to download binary files over HTTPS. The bug is related to the Cache-Control header in the HTTP response. Here you can find more information: http://support.microsoft.com/kb/323308 http://trac.edgewall.org/ticket/9584 The problem can be solved simply by using HTTP instead of HTTPS or by setting the Cache-Control in your handler to something different than 'no-cache'. The following code worked for me:
这篇关于GAE Blobstore问题 - 在Internet Explorer 8下载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
class下载(blobstore_handlers.BlobstoreDownloadHandler):
def get self):
blob = self.request.get('blob_key')
self.response.headers ['Cache-control'] ='max-age = 0'
self.send_blob(blob)
class Download(blobstore_handlers.BlobstoreDownloadHandler):
def get(self):
blob = self.request.get('blob_key')
self.response.headers['Cache-control'] = 'max-age=0'
self.send_blob(blob)