GAE Blobstore issue - download fails in internet explorer 8

时光总嘲笑我的痴心妄想 提交于 2019-12-12 06:28:44

问题


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"


回答1:


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:

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)


来源:https://stackoverflow.com/questions/7680530/gae-blobstore-issue-download-fails-in-internet-explorer-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!