.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dancer2::Core::Request::Upload 3pm" .TH Dancer2::Core::Request::Upload 3pm "2023-12-15" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Dancer2::Core::Request::Upload \- Class representing file upload requests .SH "VERSION" .IX Header "VERSION" version 1.1.0 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class implements a representation of file uploads for Dancer2. These objects are accessible within route handlers via the request\->uploads keyword. See Dancer2::Core::Request for details. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "filename" .IX Subsection "filename" Filename as sent by client. optional. May not be undef. .SS "tempname" .IX Subsection "tempname" The name of the temporary file the data has been saved to. Optional. May not be undef. .SS "headers" .IX Subsection "headers" A hash ref of the headers associated with this upload. optional. is read-write and a HashRef. .SS "size" .IX Subsection "size" The size of the upload, in bytes. Optional. .SH "METHODS" .IX Header "METHODS" .ie n .SS "my $filename=$upload\->filename;" .el .SS "my \f(CW$filename\fP=$upload\->filename;" .IX Subsection "my $filename=$upload->filename;" Returns the filename (full path) as sent by the client. .ie n .SS "my $tempname=$upload\->tempname;" .el .SS "my \f(CW$tempname\fP=$upload\->tempname;" .IX Subsection "my $tempname=$upload->tempname;" Returns the name of the temporary file the data has been saved to. .PP For example, in directory /tmp, and given a random name, with no file extension. .ie n .SS "my $href=$upload\->headers;" .el .SS "my \f(CW$href\fP=$upload\->headers;" .IX Subsection "my $href=$upload->headers;" Returns a hashRef of the headers associated with this upload. .ie n .SS "my $fh=$upload\->file_handle;" .el .SS "my \f(CW$fh\fP=$upload\->file_handle;" .IX Subsection "my $fh=$upload->file_handle;" Returns a read-only file handle on the temporary file. .ie n .SS "$upload\->copy_to('/path/to/target')" .el .SS "\f(CW$upload\fP\->copy_to('/path/to/target')" .IX Subsection "$upload->copy_to('/path/to/target')" Copies the temporary file using File::Copy. Returns true for success, false for failure. .ie n .SS "$upload\->link_to('/path/to/target');" .el .SS "\f(CW$upload\fP\->link_to('/path/to/target');" .IX Subsection "$upload->link_to('/path/to/target');" Creates a hard link to the temporary file. Returns true for success, false for failure. .ie n .SS "my $content=$upload\->content;" .el .SS "my \f(CW$content\fP=$upload\->content;" .IX Subsection "my $content=$upload->content;" Returns a scalar containing the contents of the temporary file. .ie n .SS "my $basename=$upload\->basename;" .el .SS "my \f(CW$basename\fP=$upload\->basename;" .IX Subsection "my $basename=$upload->basename;" Returns basename for \*(L"filename\*(R". .ie n .SS "$upload\->type" .el .SS "\f(CW$upload\fP\->type" .IX Subsection "$upload->type" Returns the Content-Type of this upload. .SH "SEE ALSO" .IX Header "SEE ALSO" Dancer2 .SH "AUTHOR" .IX Header "AUTHOR" Dancer Core Developers .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2023 by Alexis Sukrieh. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.