Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine and Amazon S3 File Uploads

I know this has been asked before but there is really not a clear answer. My problem is I built a file upload script for GAE and only found out after, that you can only store files up to aprox. 1MB in the data store. I can stop you right here if you can tell me that if I enable billing the 1MB limit is history but I doubt it.

I need to be able to upload up to 20mb per file so I thought maybe I can use Amazon's S3. Any ideas on how to accomplish this?

I was told to use a combination of GAE + Ec2 and S3 but I have no idea how this would work.

Thanks, Max

like image 883
mistero Avatar asked Jun 09 '09 22:06

mistero


People also ask

How do I upload files to Amazon S3?

In the Amazon S3 console, choose the bucket where you want to upload an object, choose Upload, and then choose Add Files. In the file selection dialog box, find the file that you want to upload, choose it, choose Open, and then choose Start Upload. You can watch the progress of the upload in the Transfer pane.

Is Google object storage S3 compatible?

Google Object Storage does not support S3 multi-part content uploads. The Content Platform Engine S3 implementation uses S3 multi-part uploads with a default part size of 5MB. This means that for any content larger than 5MB in size, the upload to Google Object Storage will fail.

What is the best way for the application to upload the large files in S3?

When you upload large files to Amazon S3, it's a best practice to leverage multipart uploads. If you're using the AWS Command Line Interface (AWS CLI), then all high-level aws s3 commands automatically perform a multipart upload when the object is large. These high-level commands include aws s3 cp and aws s3 sync.


1 Answers

From the Amazon S3 documentation:

  1. The user opens a web browser and accesses your web page.

  2. Your web page contains an HTTP form that contains all the information necessary for the user to upload content to Amazon S3.

  3. The user uploads content directly to Amazon S3.

GAE prepares and serves the web page, a speedy operation. You user uploads to S3, a lengthy operation, but that is between your user's browser and Amazon; GAE is not involved.

Part of the S3 protocol is a success_action_redirect, that lets you tell S3 where to aim the browser in the event of a successful upload. That redirect can be to GAE.

like image 141
Thomas L Holaday Avatar answered Oct 05 '22 00:10

Thomas L Holaday