Skip to content

Instantly share code, notes, and snippets.

@schneems
Created March 26, 2014 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schneems/9790733 to your computer and use it in GitHub Desktop.
Save schneems/9790733 to your computer and use it in GitHub Desktop.

Options for S3 Direct Upload

Goal

To updload a file directly to S3 without relying on storing data on a server in between. Why? Lets say you're having your users upload 50mb files, it's wasteful and takes up server resources to have your backend sit around and store the file only to have to send it off to S3 anway. Also if your server may go down or restart while the upload is taking place, this can happen regardless of the file size. If this happens the upload is incomplete. If the file goes directly to S3, we don't have to worry about our server availability.

Options

  • s3upload.js

No Ruby required, same lib used in Node.js article (https://devcenter.heroku.com/articles/s3-upload-node#setting-up-the-client-side-code)

https://github.com/tadruj/s3upload-coffee-javascript

  • Pre-signed post

Cannot handle multi-part upload (aws/aws-sdk-ruby#197) ?

  • s3_file_field

Handles multiple files, Ruby integration. Low active users ~4k active downloads.

  • s3_direct_upload

No multiple file support? Ruby integration. High active users ~35k.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment