Everyone loves Gmail's async-drag-and-drop-with-progress bar attachment UI. While I'd heard that HTML5 supports this type of upload, I found myself sticking with the nasty old form submission model.
While writing a media manager for eridu, I decided to finally look into it. My research into the
progress element, the
drop event, and the
FileReader object bore a tiny ~180 line Sinatra app. Download it, run
ruby dropbox.rb, and you have a complete reference implementation of a Gmail-like uploader.
Here, I'll walk though a more basic version...