Multiple File Upload with Ruby on Rails and file_column
I just found a multiple file upload script here, and a rewrite for the use with the nice file_column plugin. There was a conflict with the mootools not playing well with prototype used by default in every Ruby on Rails application. So I’ve done a rewrite of the first version of this script. Of course there are other (newer) file upload plugins like attachment_fu, but they do not have the functionality I need. Generally they should work with this solution, too.
Here is the demo (browse for an image):
In your controller you just have to parse each param:
params[:previews].each do |preview|
Preview.create(:filename => preview[1]) if !preview[1].blank?
end
That’s it! Grab the script here!
February 24th, 2008 at 19:02
I made a LGPL multiple file upload applet, and a rails plugin to go along with it to make it easy to use. It’s customizable, extensively documented, and has some great features like live progress bars and upload queuing in real time. Check it out at http://multibitshift.com.
April 5th, 2008 at 04:17
hi! im trying to get your code runing.. but i’ve this error
undefined method `filename=’ for
any idea whats happen?
btw… great blog
April 17th, 2008 at 01:27
I just updated the script regarding this bug! I hope that helps!
July 16th, 2008 at 14:51
Hey! Thanks so much for this tut! I am having the same issue txarli is having.
undefined method `filename=’ for #
Any help would be appreciated – I’ll continue to troubleshoot myself in the meantime.
Again, THANK YOU.
January 16th, 2009 at 09:12
Thanks for sharing your idea…