使用数据存储和 30 秒响应时间限制在 Google App Engine 上上传文件
谷歌应用程序引擎上的响应计时器会在提交网页表单时启动吗?
如果我要上传大于 1MB 的文件,我可以将文件拆分为 1MB,以适应 Google App Engine 数据存储区的限制。现在,我担心的是,如果客户端的互联网连接速度很慢,它会耗尽 30 秒计时器吗?如果是这样的话,连接慢的话就无法上传大文件了吗?
Will the response timer on google app engine start upon submitting the web page's form?
If I'm going to upload a file that is greater than 1MB, I could split the files to 1MB to fit in the limitation of the Google App Engine Datastore. Now, my concern is if the client's internet connection is slow, it would eat up the 30 seconds timer right? If this is the case, it is impossible to upload large files with slow connection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
30 秒响应时间限制仅适用于代码执行。因此,实际文件作为请求正文的一部分的上传被排除在外。仅当客户端将请求完全发送到服务器并且您的代码开始处理提交的请求时,计时器才会启动。因此,客户端的连接速度有多慢并不重要。
The 30 second response time limit only applies to code execution. So the uploading of the actual file as part of the request body is excluded from that. The timer will only start once the request is fully sent to the server by the client, and your code starts handling the submitted request. Hence it doesn't matter how slow your client's connection is.
附带说明一下,不要将文件拆分为多个部分,而是尝试使用 blobstore。我将它用于图像,它将存储限制提高到 50MB。 (请记住启用计费才能访问 blobstore)
As an side note, Instead of splitting your file into multiple parts, try using the blobstore. I am using it for images and it raises the storage limit to 50MB. (Remember to enable billing to get access to the blobstore)