An app that I’m building needs to be able to drop a big JSON file (up to a couple MBs) to Amazon S3. The constraint is that this can only be done from Javascript alone, as the app in question runs in the browser.
Ideally this would act as a “drop box” : people can upload a file, but not modify any or even view it once it’s uploaded.
Also, I would like to do so without “compromising” the private key for my AWS account.
I bet I have to use XHR but I’m not sure about all the details. As anyone already done that?
Best practice is to upload to a web server which forwards it to S3, With javascript you would definitely compromise your S3 keys. Even if encrypted its not that hard to decode javascript, so if you don’t use a script to forward it your keys would without a doubt be compromized.