谷歌应用引擎;上传到blobstore会产生404错误 [英] google app engine; upload to blobstore gives 404 error

查看:131
本文介绍了谷歌应用引擎;上传到blobstore会产生404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Python 2.7中使用GAE来创建一个网站,该网站可以将带有ascii数据的文件上传到blobstore。
我使用的代码与本教程中的完整示例应用程序中的相同:



https://developers.google.com/appengine/docs/python/blobstore/ #Python_Complete_sample_application



大多数情况下,上传过程都可以正常工作。但有时,我收到以下错误消息:

  404未找到
找不到资源。
没有这样的上传会话:agtkZXZ-b3BlbnZpenIiCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGICAgICA0IcLDA

有没有人遇到过这个?

解决方案 您使用 create_upload_url()某些超时(这是10分钟),所以如果您要检索这个网址在网页加载时,它需要一段时间才能上传实际的数据,它最终会过期并返回404。我建议你在上传数据之前获取上传网址。


I am using GAE with Python 2.7 to make a website which can upload files with ascii data to the blobstore. The code I am using for this is pretty much the same as given in the tutorial under the section Complete sample application:

https://developers.google.com/appengine/docs/python/blobstore/#Python_Complete_sample_application

Most of the time, the uploading process works just fine. Sometimes, however I get the following error message:

 404 Not Found
 The resource could not be found.
 No such upload session: agtkZXZ-b3BlbnZpenIiCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGICAgICA0IcLDA

Has anyone come across this before?

解决方案

The URL that you are getting with create_upload_url() has a certain timeout (which is 10 minutes) so if you are retrieving this URL when the webpage is loaded and it takes a while to upload the actual data it will eventually expire and return 404. I would suggest you to get the upload URL just before uploading the data.

这篇关于谷歌应用引擎;上传到blobstore会产生404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆