问题
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