直接从GAE上传文件到S3
我正在我的 GAE Web 应用程序中创建 XML 文件,我想将它们托管在某个地方。链接必须一致 HOST_URL + 文件名。因此,Amazon S3 看起来应该可以工作 - 我可以上传一个文件,并且 URL 直接指向该文件。 现在我的问题是 - 如何将文件从 GAE 上传到 S3? Amazon SDK 不适用于 GAE。 GAE 的上传限制是多少?是1MB还是32MB?您能否提供一个将数据直接上传到 S3 的 HTTP 请求示例?
使用 Blobstore API 会更容易吗?上传在 GAE 中创建并需要直接上传到 Blobstore API 的文件的文件大小限制是多少?
谢谢。
I am creating XML files in my GAE web application and I would like to host them somewhere. The link has to be consistent HOST_URL + filename. So Amazon S3 looks like it would work - I can upload a file and the URL is pointing directly to the file.
Now my question is - how can I upload files from GAE to S3? The Amazon SDK does not work on GAE. What is the upload limit from GAE? Is it 1MB or 32MB? Can you provide maybe a sample HTTP request for uploading data directly to S3?
Would be using the Blobstore API easier? What is the file-size limit for uploading a file that is created in GAE and need to uploaded to Blobstore API directly?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您已经注意到的,S3 api 不能很好地与 GAE 配合使用。要在 GAE 上存储文件,您可以使用 BigTable、Blobstore 或 google storage,因此请选择最适合您需求的选项。有一篇很好的文章通过代码示例此处< /a>
您可以将文件名和 blob 位置保存在 bigtable 中。
将数据存储在 GAE 上后,您可以创建一个特殊的 servlet,它会获取文件名,在 bigtable 中查找相应的数据信息,例如从 blobstore 检索它并将其返回给用户(只是一个想法)。
As you have noticed already S3 api's don't work well with GAE. For storing files on GAE you can use either BigTable, Blobstore or google storage so pick the option which best suits your needs. There is a nice article describing them all with code samples here
You can save a filename and the blob location in a bigtable.
Once you have your data stored on GAE you can create a special servlet which would take the file name, find the correspoding data informatio in bigtable, retrive it from blobstore for example and return it to the user (just an idea).