
Mojo::Upload - Upload

use Mojo::Upload;
my $upload = Mojo::Upload->new;
print $upload->filename;
$upload->copy_to('/foo/bar.txt');

Mojo::Upload is a container for uploads.

file my $file = $upload->file;
$upload = $upload->file(Mojo::File->new);
Returns a Mojo::File object if called without arguments. Returns the invocant if called with arguments.
filename my $filename = $upload->filename;
$upload = $upload->filename('foo.txt');
Returns a file name like foo.txt if called without arguments. Returns the invocant if called with arguments.
lengthmy $length = $upload->length;
Returns the length of the file upload in bytes.
headers my $headers = $upload->headers;
$upload = $upload->headers(Mojo::Headers->new);
Returns a Mojo::Headers object if called without arguments. Returns the invocant if called with arguments.
name my $name = $upload->name;
$upload = $upload->name('foo');

Mojo::Upload inherits all methods from Mojo::Base and implements the following new ones.
copy_to $upload->copy_to('/foo/bar/baz.txt');
Copies the uploaded file contents to the given path.
move_to $upload->move_to('/foo/bar/baz.txt');
Moves the uploaded file contents to the given path.
slurpmy $content = $upload->slurp;