1Mojo::Upload(3) User Contributed Perl Documentation Mojo::Upload(3)
2
3
4
6 Mojo::Upload - Upload
7
9 use Mojo::Upload;
10
11 my $upload = Mojo::Upload->new;
12 say $upload->filename;
13 $upload->move_to('/home/sri/foo.txt');
14
16 Mojo::Upload is a container for uploaded files.
17
19 Mojo::Upload implements the following attributes.
20
21 asset
22 my $asset = $upload->asset;
23 $upload = $upload->asset(Mojo::Asset::File->new);
24
25 Asset containing the uploaded data, usually a Mojo::Asset::File or
26 Mojo::Asset::Memory object.
27
28 filename
29 my $filename = $upload->filename;
30 $upload = $upload->filename('foo.txt');
31
32 Name of the uploaded file.
33
34 headers
35 my $headers = $upload->headers;
36 $upload = $upload->headers(Mojo::Headers->new);
37
38 Headers for upload, usually a Mojo::Headers object.
39
40 name
41 my $name = $upload->name;
42 $upload = $upload->name('foo');
43
44 Name of the upload.
45
47 Mojo::Upload inherits all methods from Mojo::Base and implements the
48 following new ones.
49
50 move_to
51 $upload = $upload->move_to('/home/sri/foo.txt');
52
53 Move uploaded data into a specific file.
54
55 size
56 my $size = $upload->size;
57
58 Size of uploaded data in bytes.
59
60 slurp
61 my $bytes = $upload->slurp;
62
63 Read all uploaded data at once.
64
66 Mojolicious, Mojolicious::Guides, <https://mojolicious.org>.
67
68
69
70perl v5.32.1 2021-02-07 Mojo::Upload(3)