Skip to content

Instantly share code, notes, and snippets.

Ondřej Želazko doooby

Block or report user

Report or block doooby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
doooby /
Last active Aug 29, 2015
Direct (POST) uploading to AWS S3 using aws-sdk gem

Direct uploading to AWS S3

Since there are new regions of Amazon S3 services that accepts only Signature v4 (e.g. frankfurt) you cannot use aws-sdk-v1 gem's #presigned_url functionality. And newer aws-sdk gem (beeing stil in preview for 2.x) doesn't have a functionality to do direct uploading either. Here's my inplementation of that functionality, build on top of aws-sdk v2.0.16.pre and jquery (it's using some javascript stuff that older browsers won't support though).

For some basic information see this Heroku's Direct to S3 Image Uploads in Rails article . A "how to" by Amazaon itself in Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4) (notice beelow are subsections of details, like how to create signing policy).

An exapmle for simultaneous multiple images browser-based uploading

So, I build it the way,

You can’t perform that action at this time.