Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Dancer2::Core::RequestUserlContributed Perl DDancer2::Core::Request::Upload(3)

NAME
       Dancer2::Core::Request::Upload -	Class representing file	upload
       requests

VERSION
       version 0.300004

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.

ATTRIBUTES
   filename
       Filename	as sent	by client. optional. May not be	undef.

   tempname
       The name	of the temporary file the data has been	saved to. Optional.
       May not be undef.

   headers
       A hash ref of the headers associated with this upload. optional.	is
       read-write and a	HashRef.

   size
       The size	of the upload, in bytes. Optional.

METHODS
   my $filename=$upload->filename;
       Returns the filename (full path)	as sent	by the client.

   my $tempname=$upload->tempname;
       Returns the name	of the temporary file the data has been	saved to.

       For example, in directory /tmp, and given a random name,	with no	file
       extension.

   my $href=$upload->headers;
       Returns a hashRef of the	headers	associated with	this upload.

   my $fh=$upload->file_handle;
       Returns a read-only file	handle on the temporary	file.

   $upload->copy_to('/path/to/target')
       Copies the temporary file using File::Copy. Returns true	for success,
       false for failure.

   $upload->link_to('/path/to/target');
       Creates a hard link to the temporary file. Returns true for success,
       false for failure.

   my $content=$upload->content;
       Returns a scalar	containing the contents	of the temporary file.

   my $basename=$upload->basename;
       Returns basename	for "filename".

   $upload->type
       Returns the Content-Type	of this	upload.

SEE ALSO
       Dancer2

AUTHOR
       Dancer Core Developers

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2020 by Alexis Sukrieh.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.0			  2020-05-27 Dancer2::Core::Request::Upload(3)

NAME | VERSION | DESCRIPTION | ATTRIBUTES | METHODS | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Dancer2::Core::Request::Upload&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help