GAE Blobstore issue - download fails in internet e

2019-09-12 10:19发布

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条回答
我想做一个坏孩纸
2楼-- · 2019-09-12 10:58

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)
查看更多
登录 后发表回答