[html-formfu] file upload changes

Carl Franks fireartist at gmail.com
Fri Jan 11 15:58:23 GMT 2008


If you're using $form->query_type('Catalyst') - which is automatically
set for you if you're using Catalyst::Controller::HTML::FormFu - you
now have access to the Catalyst::Request::Upload methods.

    my $param = $form->param('file');

    $param->basename;
    $param->copy_to;
    $param->link_to;
    $param->size;
    $param->tempname;
    $param->type;

You can also get the original Catalyst::Request::Upload object with:

    $param->catalyst_upload;

I've made an incompatible change - headers() now returns a
HTTP::Headers object rather than a hashref. - This is the default
behaviour of Catalyst::Request::Upload->headers().

The CGI and CGI::Simple query-types have also been updated to provide
size() and type() methods, which simply dispatch to
$upload->headers->content_length() and
$upload->headers->content_type().

Note that the CGI and CGI::Simple query-types do not at this time
provide the other catalyst-like methods listed above.

Carl



More information about the HTML-FormFu mailing list