From: Austin Ziegler Date: 2003-11-04T01:25:31+09:00 Subject: Re: CGI uses file size to distinguish between regular values and files On Tue, 4 Nov 2003 00:43:49 +0900, Jesper Olsen wrote: > I'm using the CGI module for file upload - I think it works, it is > just poorly documented. > > At least it works for me - I use it mainly for uploading binary > files (jpg images) - typically in the range 1k-100k bytes in size > - but also larger. > Anyway, my code looks like this (upload.rbx) > cgi=CGI.new > if cgi.has_key?('image') > image=cgi['image'][0].read > end This is what I *don't* want. I shouldn't *have* to handle it differently (I think that the Perl mechanism is even worse), but I should be able handle it differently if I want. Not only that, as the OP said at the beginning of this thread, if the size of the file is large enough, then *all* CGI parameters are turned into tempfiles, requiring a #read on all of them, depending on the size of the file being uploaded. When I have a file uploaded, I have the file and five other parameters. I shouldn't have to do a #read on all of the parameters. Give me a way to access the temp files behind the data, but I'm not at all interested in *having* to access the temp files unless I explicitly want to. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.11.03 * 11.15.01