1Catalyst::Request::UploUasde(r3)Contributed Perl DocumenCtaattailoynst::Request::Upload(3)
2
3
4
6 Catalyst::Request::Upload - handles file upload requests
7
9 my $upload = $c->req->upload('field');
10
11 $upload->basename;
12 $upload->copy_to;
13 $upload->fh;
14 $upload->filename;
15 $upload->headers;
16 $upload->link_to;
17 $upload->size;
18 $upload->slurp;
19 $upload->tempname;
20 $upload->type;
21
22 To specify where Catalyst should put the temporary files, set the
23 'uploadtmp' option in the Catalyst config. If unset, Catalyst will use
24 the system temp dir.
25
26 __PACKAGE__->config( uploadtmp => '/path/to/tmpdir' );
27
28 See also Catalyst.
29
31 This class provides accessors and methods to handle client upload
32 requests.
33
35 $upload->new
36 Simple constructor.
37
38 $upload->copy_to
39 Copies the temporary file using File::Copy. Returns true for success,
40 false for failure.
41
42 $upload->copy_to('/path/to/target');
43
44 $upload->fh
45 Opens a temporary file (see tempname below) and returns an IO::File
46 handle.
47
48 $upload->filename
49 Returns the client-supplied filename.
50
51 $upload->headers
52 Returns an HTTP::Headers object for the request.
53
54 $upload->link_to
55 Creates a hard link to the temporary file. Returns true for success,
56 false for failure.
57
58 $upload->link_to('/path/to/target');
59
60 $upload->size
61 Returns the size of the uploaded file in bytes.
62
63 $upload->slurp
64 Returns a scalar containing the contents of the temporary file.
65
66 $upload->basename
67 Returns basename for "filename".
68
69 $upload->tempname
70 Returns the path to the temporary file.
71
72 $upload->type
73 Returns the client-supplied Content-Type.
74
75 meta
76 Provided by Moose
77
79 Catalyst Contributors, see Catalyst.pm
80
82 This library is free software. You can redistribute it and/or modify it
83 under the same terms as Perl itself.
84
85
86
87perl v5.12.1 2009-11-22 Catalyst::Request::Upload(3)