On Sun, Jan 24, 2010 at 8:31 AM, Octavian Rasnita <orasn...@gmail.com>wrote: > > >> Give your upload field(s) a name like "upload_1" and then see if it >> exists >> in uploads. >> > > I gave it the name "file", but if the file is not uploaded, it doesn't > appear in uploads(). (I hope "file" is OK as a name, no?)
Why do you need to know that a field existed on the form but was submitted empty? Checkboxes don't submit if not checked. You get what's included in the post and have to work from that. Either you have an upload or not, right? Aha, so I should look better in HTTP::Body. Is there a reason it does that? (Leaves alone all other empty form fields > but deletes the empty file upload fields?) Without commends in the code or documentation can't really know the author's reasoning. I guess it assume uploads go to temp files and no need to do that if there's no content. (IIRC, I thought "filename" was optional, but maybe I'm mistaken.) I'm kind of curious why it does this: if ( $part->{fh} && ( my $length = length( $part->{data} ) ) ) { $part->{fh}->write( substr( $part->{data}, 0, $length, '' ), $length ); } instead of: print $part->{fh} $part->{data} if $part->{fh}; Maybe for fear of line ending conversion?? -- Bill Moseley mose...@hank.org
_______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/