-
-
10 Mar 2014 14:46:10 UTC
- Distribution: Catalyst-Runtime
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues (27)
- Testers (675 / 0 / 0)
- Kwalitee
Bus factor: 12- License: perl_5
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (307.91KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- CGI::Simple::Cookie
- CGI::Struct
- Carp
- Class::C3::Adopt::NEXT
- Class::Data::Inheritable
- Class::Load
- Data::Dump
- Data::OptList
- Devel::InnerPackage
- Encode
- HTML::Entities
- HTML::HeadParser
- HTTP::Body
- HTTP::Headers
- HTTP::Request
- HTTP::Request::AsCGI
- HTTP::Response
- Hash::MultiValue
- JSON::MaybeXS
- LWP
- List::MoreUtils
- MRO::Compat
- Module::Pluggable
- Moose
- MooseX::Emulate::Class::Accessor::Fast
- MooseX::Getopt
- MooseX::MethodAttributes::Role::AttrContainer::Inheritable
- MooseX::Role::WithOverloading
- Path::Class
- Plack
- Plack::Middleware::Conditional
- Plack::Middleware::ContentLength
- Plack::Middleware::FixMissingBodyInRedirect
- Plack::Middleware::HTTPExceptions
- Plack::Middleware::Head
- Plack::Middleware::IIS6ScriptNameFix
- Plack::Middleware::IIS7KeepAliveFix
- Plack::Middleware::LighttpdScriptNameFix
- Plack::Middleware::MethodOverride
- Plack::Middleware::RemoveRedundantBody
- Plack::Middleware::ReverseProxy
- Plack::Request::Upload
- Plack::Test::ExternalServer
- Safe::Isa
- Scalar::Util
- Stream::Buffered
- String::RewritePrefix
- Sub::Exporter
- Task::Weaken
- Text::Balanced
- Text::SimpleTable
- Time::HiRes
- Tree::Simple
- Tree::Simple::Visitor::FindByPath
- Try::Tiny
- URI
- namespace::autoclean
- namespace::clean
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catalyst::Request::Upload - handles file upload requests
SYNOPSIS
my $upload = $c->req->upload('field'); $upload->basename; $upload->copy_to; $upload->fh; $upload->filename; $upload->headers; $upload->link_to; $upload->size; $upload->slurp; $upload->tempname; $upload->type;
To specify where Catalyst should put the temporary files, set the 'uploadtmp' option in the Catalyst config. If unset, Catalyst will use the system temp dir.
__PACKAGE__->config( uploadtmp => '/path/to/tmpdir' );
See also Catalyst.
DESCRIPTION
This class provides accessors and methods to handle client upload requests.
METHODS
$upload->new
Simple constructor.
$upload->copy_to
Copies the temporary file using File::Copy. Returns true for success, false for failure.
$upload->copy_to('/path/to/target');
$upload->fh
Opens a temporary file (see tempname below) and returns an IO::File handle.
$upload->filename
Returns the client-supplied filename.
$upload->headers
Returns an HTTP::Headers object for the request.
$upload->link_to
Creates a hard link to the temporary file. Returns true for success, false for failure.
$upload->link_to('/path/to/target');
$upload->size
Returns the size of the uploaded file in bytes.
$upload->slurp
Returns a scalar containing the contents of the temporary file.
Note that this will cause the filehandle pointed to by
$upload->fh
to be reset to the start of the file using seek and the file handle to be put into binary mode.$upload->basename
Returns basename for
filename
.$upload->tempname
Returns the path to the temporary file.
$upload->type
Returns the client-supplied Content-Type.
meta
Provided by Moose
AUTHORS
Catalyst Contributors, see Catalyst.pm
COPYRIGHT
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Catalyst::Runtime, copy and paste the appropriate command in to your terminal.
cpanm Catalyst::Runtime
perl -MCPAN -e shell install Catalyst::Runtime
For more information on module installation, please visit the detailed CPAN module installation guide.