The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::FormHandler::Field::Upload - File upload field

DESCRIPTION

This field is designed to be used with Catalyst::Request::Upload. Validates that the input is an uploaded file. A form containing this field must have the enctype set.

    package My::Form::Upload;
    use HTML::FormHandler::Moose;
    extends 'HTML::FormHandler';

    has '+enctype' => ( default => 'multipart/form-data');

    has_field 'file' => ( type => 'Upload' );
    has_field 'submit' => ( type => 'Submit', value => 'Upload' );

In your controller:

    my $form = My::Form::Upload->new; 
    my @params = ( file => $c->req->upload('file') ) 
             if $c->req->method eq 'POST';
    $form->process( params => { @params } );
    return unless ( $form->validated );

DEPENDENCIES

widget

Widget type is 'upload'

AUTHOR

Bernhard Graf & Oleg Kostyuk

and FormHandler contributors

LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.