如何从文件GAE(恐怖故事)上传到S3恐怖、文件、故事、GAE

2023-09-11 09:54:40 作者:鬓边桃花

我想从GAE上传文件到Amazon S3。

I am trying to upload a file to amazon S3 from GAE.

我试过亚马逊官方SDK(的JetS3t ,建立在顶部较低级别的人员),只是为了发现,即使你可以得到它通过设置本地工作一旦你部署它它不支持GAE加密相关的原因在本地JVM的权限。

I tried the official amazon sdk (jetS3t, built on top of the lower-level sdk), just to find out that even if you can get it to work locally by setting permissions on the local JVM it is not supported for GAE crypto-related reasons once you deploy it.

然后绝望的我发现,一些善良的灵魂分叉官方低-level亚马逊SDK ,这样它将与GAE。这种工作(尽管我可以在这里看到被扔一些strage空指针异常和那里)和文件被上传...但如果​​文件大小超过5MB,我从API中得到一个错误:

Then out of desperation I found that some good soul forked the official low-level amazon sdk so that it would work with GAE. This kind of works (even though I can see some strage NullPointer exceptions being thrown here and there) and the file gets uploaded ... but if the file size exceeds 5MB I am getting a error from within the API:

com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call urlfetch.Fetch() was too large

我不完全了解这是目前GAE的限制似乎是32MB的文件大小上载和1MB的请求/响应,而我的问题是存在的,只有当该文件的大小约为5MB或更大。

I don't fully understand this as the current GAE limitations seem to be 32MB on file size upload and 1MB on request/response while my problem is occurring only when the file is around 5MB or bigger.

我想我唯一的选择左边的是 jclouds ,但我无法找到文件上传到S3的例子使用Blob存储库。

I think my only alternative left is jclouds, but I am having trouble finding examples of uploading files to S3 using the BlobStore library.

没有人有经验/实例共享S3文件上传与jClouds的?而我可能在发生同样的 urlfetch.Fetch()太大 错误?

任何帮助AP preciated。

Any help appreciated.

推荐答案

URLFetch申请数量限定为5MB,作为记录的此处。唯一的解决方案,将工作是涉及打破了一个大的有效载荷送入小块。幸运的是,S3提供了一个多部分上传API 。

URLFetch requests are limited to 5MB, as documented here. The only solutions that will work are those that involve breaking up a large payload into smaller chunks. Fortunately, S3 provides a multipart upload API.