The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojo::Upload - Upload

SYNOPSIS

use Mojo::Upload;

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

DESCRIPTION

Mojo::Upload is a container for uploads.

ATTRIBUTES

Mojo::Upload implements the following attributes.

asset

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

filename

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

headers

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

name

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

METHODS

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

move_to

$upload->move_to('/foo/bar/baz.txt');

size

my $size = $upload->size;

slurp

my $string = $upload->slurp;