I’m using Ruby on Rails 3 deployed at heroku. Now I have working fine a multiple image attachment using paperclip and amazon s3 for storage. But, when I submit the form, I have to wait too long time. For this reason I would upload the images asynchronously, using Ajax. Any example or tip? Thanks!
UPDATE: There is something that I don’t understand. When you are filling the form of Post (for example) that have a multiple image attachment, the Post isn’t created until you submit the form, then it don’t have an ID. The Images belongs_to Post througt the post_id, then: How the plugin Jquery Uploader or Uploadify can save the images asyncronaly?
Asynchronous file uploading (with progress indication) via XMLHttpRequest isn’t yet supported by all browsers, but the best jQuery plugin I’ve come across to do it is jQuery-File-Upload (demo here). It works with Chrome, Safari, Firefox, Opera, and MSIE, although MSIE doesn’t yet have support for progress indication, unfortunately. The uploader is for all file types by default, but you can limit it to images.
Hopefully in future all browsers will be able to do this via AJAX, though at the moment you’ll have to use Flash for completely cross-browser support.