Catalyst::Request::Upload.3pm

Langue: en

Version: 2009-02-04 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

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

SYNOPSIS

     $upload->basename;
     $upload->copy_to;
     $upload->fh;
     $upload->filename;
     $upload->headers;
     $upload->link_to;
     $upload->size;
     $upload->slurp;
     $upload->tempname;
     $upload->type;
 
 

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.

DESCRIPTION

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

METHODS


$upload->new


$upload->new

Simple constructor.

$upload->copy_to


$upload->copy_to

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

      $upload->copy_to('/path/to/target');
 
 

$upload->fh


$upload->fh

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

$upload->filename


$upload->filename

Returns the client-supplied filename.

$upload->headers


$upload->headers

Returns an HTTP::Headers object for the request.

$upload->link_to


$upload->link_to

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

     $upload->link_to('/path/to/target');
 
 

$upload->size


$upload->size

Returns the size of the uploaded file in bytes.

$upload->slurp


$upload->slurp

Returns a scalar containing the contents of the temporary file.

$upload->basename


$upload->basename

Returns basename for "filename".

$upload->tempname


$upload->tempname

Returns the path to the temporary file.

$upload->type


$upload->type

Returns the client-supplied Content-Type.

AUTHORS

Catalyst Contributors, see Catalyst.pm This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.