Catalyst::Request::Upload - handles file upload requests


    my $upload = $c->req->upload('field');


To specify where Catalyst should put the temporary files, set the 'uploadtmp' option in the Catalyst config. If unset, Catalyst will use the system temp dir.

    __PACKAGE__->config( uploadtmp => '/path/to/tmpdir' );

See also Catalyst.


This class provides accessors and methods to handle client upload requests.



Simple constructor.


Copies the temporary file using File::Copy. Returns true for success, false for failure.



Opens a temporary file (see tempname below) and returns an IO::File handle.


Returns the client-supplied filename.


Returns an HTTP::Headers object for the request.

Creates a hard link to the temporary file. Returns true for success, false for failure.



Returns the size of the uploaded file in bytes.


Returns a scalar containing the contents of the temporary file.

Note that this will cause the filehandle pointed to by $upload->fh to be reset to the start of the file using seek and the file handle to be put into binary mode.


Returns basename for filename.


Returns the path to the temporary file.


Returns the client-supplied Content-Type.


Provided by Moose


Catalyst Contributors, see


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