Upload Directly to Amazon S3 With jQuery
I wrote a simple Sinatra app to upload files directly to Amazon S3 using SWFUpload, check it out on GitHub Most of the inspiration (and a lot of the core code) came from Tom Pesman's post on how to do the same thing, just in rails. I ported Tom's code to use jQuery and the jQuery swfupload plugin. I also converted most of the views to HAML.
A couple of notes about the code: The ruby code I borrowed from Tom used a couple Rails specific helper functions like 'hours' but thankfully these helper functions are all easily accessible in sinatra by including the active_support gem.
Also, you must put the crossdomain.xml file in the root of your S3 Bucket and give it read privileges.
This is my first open source contribution! If you have any questions, ideas on how to make the code better, or even feature requests let me know! Its pretty bare bones right now, maybe I'll add some styling and some progress indicators later.
The Sinatra App is available on github. It is uses by these libraries:
Ruby: sinatra active_support/core_ext base64