manpagez: man pages & more
man Mojo::Upload(3)
Home | html | info | man
Mojo::Upload(3)       User Contributed Perl Documentation      Mojo::Upload(3)




NAME

       Mojo::Upload - Upload


SYNOPSIS

         use Mojo::Upload;

         my $upload = Mojo::Upload->new;
         say $upload->filename;
         $upload->move_to('/home/sri/foo.txt');


DESCRIPTION

       Mojo::Upload is a container for uploaded files.


ATTRIBUTES

       Mojo::Upload implements the following attributes.

   asset
         my $asset = $upload->asset;
         $upload   = $upload->asset(Mojo::Asset::File->new);

       Asset containing the uploaded data, usually a Mojo::Asset::File or
       Mojo::Asset::Memory object.

   filename
         my $filename = $upload->filename;
         $upload      = $upload->filename('foo.txt');

       Name of the uploaded file.

   headers
         my $headers = $upload->headers;
         $upload     = $upload->headers(Mojo::Headers->new);

       Headers for upload, usually a Mojo::Headers object.

   name
         my $name = $upload->name;
         $upload  = $upload->name('foo');

       Name of the upload.


METHODS

       Mojo::Upload inherits all methods from Mojo::Base and implements the
       following new ones.

   move_to
         $upload = $upload->move_to('/home/sri/foo.txt');

       Move uploaded data into a specific file.

   size
         my $size = $upload->size;

       Size of uploaded data in bytes.

   slurp
         my $bytes = $upload->slurp;

       Read all uploaded data at once.


SEE ALSO

       Mojolicious(3), Mojolicious::Guides(3), <https://mojolicious.org>.



perl v5.32.1                      2021-12-08                   Mojo::Upload(3)

mojolicious 9.260.0 - Generated Mon May 30 16:16:08 CDT 2022
© manpagez.com 2000-2025
Individual documents may contain additional copyright information.