Forum: Ruby on Rails Multiple File Uploads

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ae4ee8d59ee17d8672c3a83b7a7dfe8c?d=identicon&s=25 plewizard (Guest)
on 2007-03-13 05:58
(Received via mailing list)
Hey, I'm looking for a good and complete how to to implement multiple
file uploads in a form.  I've been looking for hours now, trying a few
snippets or bits or various forums, and I'd love it if someone who had
a real good grasp on ruby could show me (and everyone else) a ruby way
to implement it.  so far all I've found is hacks that don't really
work.  I'm familiar with file_column, acts_as_attachment, and
attachment_fu and have gotten all of them to work with one file.  I've
even tried combing through mephisto's code, but i can't make what Rick
does there work.

Any help would be awesome.
Fbd9cb107fe7c941333d6a3488691989?d=identicon&s=25 Ramon Tayag (ramontayag)
on 2007-03-14 09:12
(Received via mailing list)
This'd be great to know!  Any recommendations?

On 3/13/07, plewizard <somethingnoonehasthoughtof@gmail.com> wrote:
>
> Any help would be awesome.
>
>
> >
>


--
Ramon Miguel M. Tayag
E3513c4edd6810bb4b9914b58da2a2c3?d=identicon&s=25 Jamal Soueidan (jamal)
on 2007-03-14 11:29
plewizard wrote:
> Hey, I'm looking for a good and complete how to to implement multiple
> file uploads in a form.  I've been looking for hours now, trying a few
> snippets or bits or various forums, and I'd love it if someone who had
> a real good grasp on ruby could show me (and everyone else) a ruby way
> to implement it.  so far all I've found is hacks that don't really
> work.  I'm familiar with file_column, acts_as_attachment, and
> attachment_fu and have gotten all of them to work with one file.  I've
> even tried combing through mephisto's code, but i can't make what Rick
> does there work.
>
> Any help would be awesome.

Use flash and make your life simple :D
Fbd9cb107fe7c941333d6a3488691989?d=identicon&s=25 Ramon Tayag (ramontayag)
on 2007-03-14 13:11
(Received via mailing list)
True...

http://blog.vixiom.com/2006/09/08/multiple-file-up...

On 3/14/07, Jamal Soueidan <rails-mailing-list@andreas-s.net> wrote:
>
> Use flash and make your life simple :D

--
Ramon Miguel M. Tayag
3d1a70ebd35ac970e009e01599603b46?d=identicon&s=25 koloa (Guest)
on 2007-03-14 16:30
hey, acts as attachment handles multiple file uploads easily..

here is what you do....

2 models....article and photo...article has_many photos and photo
belongs_to article. create your aaa model and include the article_id in
the photo table. next when you create your form, instantiate more
dvd_covers. like dvd_cover1 = Photo.new...dvd_cover2 = Photo.new....

now in your form, add the newly created file fields. when your in the
submit action build it how you would a has_many relationship. something
like

myarticle = Article.new

myarticle.build_photo(params[:dvdcover1_uploaded_data])
myarticle.build_photo(params[:dvdcover2_uploaded_data])

etc...
3d1a70ebd35ac970e009e01599603b46?d=identicon&s=25 koloa (Guest)
on 2007-03-14 16:31
i will post the write up in my blog at railsgrunt.com when i get home.
This topic is locked and can not be replied to.