[Html-widget] file uploads and element_type combined patch

John Napiorkowski jjn1056 at yahoo.com
Fri Nov 17 16:58:31 GMT 2006


[snip]
> > Here's an example of a filter I wrote that resizes
> an
> > uploaded image:
[snip]
> I think it's wrong for the filter to take in a file
> upload object, and
> return a blob/string.
> What if you want to run multiple filters on an
> uploaded file? The
> first one will turn it into a normal string variable
> and the following
> filters will choke.
> The filter should write back to the $file->fh()
> file.

:( seems this will be hard to do with Catalyst, unless
the maintainers are willing to accept a patch:

(in Catalyst::Request::Upload->fh)
my $fh = IO::File->new( $self->tempname,
IO::File::O_RDONLY );

Also it looks like they don't save the filehandle when
you do ->fh, this method just returns it new each
time.

Maybe the best this to do is to create a new
H:W:Upload object and populate it with info from the
Catalyst Upload object.  That way we don't mess with
it at all if later in the processing cycle a different
controller needs it for some other purpose.  We could
make the filehande RW as well.

--john


 
____________________________________________________________________________________
The all-new Yahoo! Mail beta
Fire up a more powerful email and get things done faster. 
http://new.mail.yahoo.com




More information about the Html-widget mailing list