Renan
Renan

Reputation: 2000

Multiple files upload chosen in the same browse file window (Ruby on Rails)

I've searched for "multiple files upload in ruby on rails" and the plugins that were suggested always displayed multiple <input type="file" ...> tags. I'm looking for something where I can choose multiple files in the same browse file window, like when uploading photos on facebook.

I've found this one, but it requires some under-the-hood coding to be used in RoR (it is ready for PHP).

My requirements are really basic: I only need to be able to upload files facebook-like. No visual effects needed, or progress bars or whatever. So maybe I'm thinking about implementing my own uploader, but I don't know where to start.

So if you got either 1) a suggestion of RoR plugin that might do what I just described or 2) tips on how to implement one myself, I'd be very glad to hear them.

Upvotes: 0

Views: 703

Answers (2)

Callmeed
Callmeed

Reputation: 5002

I've had good success with the jQuery File Upload Plugin. It uses both the HTML5 "multiple" attribute for file inputs and drag-and-drop uploading.

If you're using paperclip and jQuery, you can get it integrated in your app pretty quickly.

Upvotes: 0

Jeremy Roman
Jeremy Roman

Reputation: 16355

I've heard good things about Plupload and, to a lesser extent, Uploadify. The former uses a variety of techniques transparently to try and achieve multi-file upload (using the HTML5 API if possible); the latter only supports Flash (though this is what many users will end up using).

Integrating these with Rails is just a matter of implementing the API they expect, which is fairly straightforward.

Here is a post by someone who has taken the effort of making sure CSRF protection and Flash session cookies even co-operate. http://planetrails.com/plupload-with-rails-3

I have not followed that particular guide myself, but it seems correct.

Upvotes: 1

Related Questions