开发者

Uploading Directly to S3 on CORS without Flash, from HTTPS hosted site

开发者 https://www.devze.com 2023-04-01 06:01 出处:网络
We are looking at an option for uploading large files (in ~100MB+) to S3. The html-form also contains other meta information about the file, that will be stored in our application database and not in

We are looking at an option for uploading large files (in ~100MB+) to S3.

The html-form also contains other meta information about the file, that will be stored in our application database and not in S3. Based on the success/failure of the file-upload to S3, the metadata about the image will be inserted to our application DB.

The application is on Ruby-on-Rails stack and is HTTPS enabled. Form submission to S3, is ruled out, so is a flash based upload. All the other choices we have cons开发者_运维知识库idered, have their own limitations.

  1. Direct JS upload is not possible because of cross-domain (CORS) limitation with S3.

  2. Configuring the HTTP server (nginx) with OPTIONS as mentioned here (http://zefer.posterous.com/pure-html-ajax-solutions-to-upload-files-to-s). But the application (i.e, nginx) will run behind ElasticLoadBalancer on HTTPS. Is there a better way to handle this requirement on ELB ?

Are there other good patterns for this requirement in AWS World ?

Thanks, Sriram


CORS is now supported, so your option 1 will now work http://aws.typepad.com/aws/2012/08/amazon-s3-cross-origin-resource-sharing.html


Why do you say form submission is ruled out?
http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html

0

精彩评论

暂无评论...
验证码 换一张
取 消