Forum: Ruby on Rails N file uploads from one post - one File, (N-1) StringIOs

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.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-04 00:15
All,

Win XP
Ruby 1.8.4
Rails 1.1

I have a multipart form that I am posting with a dynamic number of
file_fields that are generated on it, say N.

When I post this form and look at the form params, I see one "File"
object and N-1 "StringIO" objects.

It appears that I should be able to manipulate these the way that I
would like (file-wise), so I think it's not a problem.

I've verified that regardless of the number of file fields N, if N > 1,
then I will get a File object and (N-1) StringIO objects.

Anyone know why I get the StringIO objects and why the first one is a
File?

I've looked at the CGI.rb docs and I see that StringIO and Tempfile are
what's expected.  I just wanted to be sure that this was normal
behavior.

Thanks,
Wes
This topic is locked and can not be replied to.