1Mojo::Upload(3) User Contributed Perl Documentation Mojo::Upload(3)
2
3
4
6 Mojo::Upload - Upload Container
7
9 use Mojo::Upload;
10
11 my $upload = Mojo::Upload->new;
12 print $upload->filename;
13 $upload->move_to('/foo/bar/baz.txt');
14
16 Mojo::Upload is a container for uploads.
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.
26
27 "filename"
28 my $filename = $upload->filename;
29 $upload = $upload->filename('foo.txt');
30
31 Name of the uploaded file.
32
33 "headers"
34 my $headers = $upload->headers;
35 $upload = $upload->headers(Mojo::Headers->new);
36
37 Headers for upload.
38
39 "name"
40 my $name = $upload->name;
41 $upload = $upload->name('foo');
42
43 Name of the upload.
44
46 Mojo::Upload inherits all methods from Mojo::Base and implements the
47 following new ones.
48
49 "move_to"
50 $upload->move_to('/foo/bar/baz.txt');
51
52 Move uploaded data to a specific file.
53
54 "size"
55 my $size = $upload->size;
56
57 Size of upload in bytes.
58
59 "slurp"
60 my $string = $upload->slurp;
61
62 Read all upload data at once.
63
65 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
66
67
68
69perl v5.12.3 2010-08-12 Mojo::Upload(3)