CGI::Lite::Request::Upload - Upload objects for CGI::Lite


NAME

CGI::Lite::Request::Upload - Upload objects for CGI::Lite


SYNOPSIS

  $upload = CGI::Lite::Request::Upload->new;
  
  # getters
  $upload->filename;
  $upload->tempname;
  $upload->size;
  $upload->type;
  
  # copy and hard link
  $upload->copy_to('/target/path');
  $upload->link_to('/target/path');
  
  $fh = $upload->fh;
  $content = $upload->slurp;


DESCRIPTION

These objects are created automatically during the parse of the incoming request by the CGI::Lite::Request manpage, and shouldn't be instantiated directly.


METHODS

new

simple constructor

filename

returns the filename of the uploaded file

tempname

returns the name of the temporary file to which the content has been spooled

size

returns the size of the uploaded file

type

returns the MIME type of the file (guessed with the File::Type manpage)

copy_to('/path/to/destination')

copies the file to the destination

fh

returns an the IO::File manpage object with the temporary file opened read only

link_to('/path/to/destination')

links the temporary file to the destination

slurp

reads and returns the contents of the uploaded file


AUTHOR

Richard Hundt <richard NO SPAM AT protea-systems.com>


SEE ALSO

the CGI::Lite manpage, the File::Type manpage, the CGI::Lite::Request manpage, the IO::File manpage


LICENCE

This library is free software and may be used under the same terms as Perl itself