Forum: Ruby on Rails HOWTO: Multiple file upload with file_column

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8e7e5b934fcbcdfb475072685755457f?d=identicon&s=25 Taylor Strait (Guest)
on 2007-03-19 01:47
Lots of requests but not many answers on this topic.  Here is how you do

<% for i in 1..6 %>
    <td class='Label'><label>Title</label></td>
    <td><input id="<%= "picture_#{i}_title" %>" name="<%=
"picture[#{i}][title]" %>" size="30" type="text" /></td>
    <td class='Label'><label for="image_data">Image</label></td>
    <td><input id="<%= "picture_#{i}_image_data_temp" %>" name="<%=
"picture[#{i}][image_data_temp]" %>" type="hidden" />
        <input id="<%= "picture_#{i}_image_data" %>" name="<%=
"picture[#{i}][image_data]" %>" size="30" type="file" /></td>
    <td><br /></td>
<% end %>

      params[:picture].each { |attr, value|
                            unless value[:image_data].blank?
                              new_image =
                              new_image.person_id = session[:person_id]
                              new_image.title = value[:title]
                              new_image.image = value[:image_data]

class Image < ActiveRecord::Base

  file_column :image

D4ecf6097193e43bf0bf6ea186fcfbd0?d=identicon&s=25 matthibcn (Guest)
on 2007-03-19 15:42
(Received via mailing list)
Taylor Strait schrieb:
>   </tr>
> <% end %>
Hi Taylor,

how do you handle and display the errormessages, e.g: the 1st and 3rd
file donĀ“t match filesize or filetype etc out of a total of 4 ??

Best regards

ps: i have also multiple_file upload running, even my code is different,
the error_message_stuff should/could be handled the same
This topic is locked and can not be replied to.