【问题标题】:GAE Blobstore issue - download fails in internet explorer 8GAE Blobstore 问题 - 在 Internet Explorer 8 中下载失败
【发布时间】:2011-10-06 21:14:38
【问题描述】:

我在使用 send_blob 函数向 Internet Explorer 提供文件时遇到问题。文件很小,从 0.5Mb 到 5Mb。在 Firefox 和 Chrome 中一切正常,但在 IE 8.0 中我得到下载进度窗口,几秒钟后出现错误:

“无法从 [此处的域名] 下载 [此处的 blob 密钥]

无法打开此 Internet 站点。请求的站点不可用或找不到。请稍后再试”

【问题讨论】:

    标签: python internet-explorer google-app-engine blobstore


    【解决方案1】:

    这个问题是由尝试通过 HTTPS 下载二进制文件时 IE 中的错误引起的。该错误与 HTTP 响应中的 Cache-Control 标头有关。

    在这里您可以找到更多信息:

    http://support.microsoft.com/kb/323308

    http://trac.edgewall.org/ticket/9584

    可以通过使用 HTTP 而不是 HTTPS 或将处理程序中的 Cache-Control 设置为不同于“no-cache”的东西来解决问题。以下代码对我有用:

    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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-24
      • 1970-01-01
      • 1970-01-01
      • 2011-04-26
      • 1970-01-01
      • 2010-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多