[Catalyst] Emulating Catalyst::Request::Upload for HTML::FormHandler
Shlomi Fish
shlomif at iglu.org.il
Tue Aug 10 18:59:55 GMT 2010
Hi good people,
for my work Catalyst project we allow the user to upload a user-pic ("avatar",
etc.) and then we need to resize it to be up to a certain limit. I can easily
resize the uploaded file using Imager or whatever, but I need a way for
HTML::FormHandler to accept it instead of the original uploaded file. Here are
the relevant docs:
http://search.cpan.org/perldoc?Catalyst::Request::Upload
(contains usage information but not much information how to construct a valid
object.)
http://search.cpan.org/perldoc?HTML::FormHandler::Field::Upload
(explains that I should just use Catalyst::Request::Upload but not what it
expects from it).
I already tried to call ->fh($file_handle) where $file_handle is something I
opened using open my $file_handle, "<", \$buffer; but no luck - got some
stat() warning from File::Copy and my tests failed.
I did not get any reply for this on IRC so I'm asking here.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan
God considered inflicting XSLT as the tenth plague of Egypt, but then
decided against it because he thought it would be too evil.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
More information about the Catalyst
mailing list