Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save data on S3 using Javascript or Jquery

I want to collect data entered by the user in a browser and save to Amazon S3. Is this something I can do with Javascript/Jquery?

like image 399
WooHoo Avatar asked Feb 11 '11 19:02

WooHoo


1 Answers

I know this is an old question, but I had the same issue and think I've found a solution. S3 has a REST interface to which you can POST data directly, without exposing your AWS Secret Key. So, you can construct an AJAX POST request to your S3 bucket endpoint using Javascript or jQuery. You can specify an access policy in the request as well, which restricts upload access to only certain buckets and certain directories.

Amazon verifies the authenticity of your requests using an HMAC signature which you provide in the request. The signature is constructed using details about the request and your AWS Secret Key, which only you and Amazon know, so fraudulent requests can't be made without someone having a valid signature.

like image 156
Dan Applegate Avatar answered Oct 28 '22 13:10

Dan Applegate