diff options
Diffstat (limited to 'lib/Web/Request/Upload.pm')
-rw-r--r-- | lib/Web/Request/Upload.pm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Web/Request/Upload.pm b/lib/Web/Request/Upload.pm index c7d0bf3..674ab8d 100644 --- a/lib/Web/Request/Upload.pm +++ b/lib/Web/Request/Upload.pm @@ -1,10 +1,25 @@ package Web::Request::Upload; use Moose; +# ABSTRACT: class representing a file upload use HTTP::Headers; use Web::Request::Types; +=head1 SYNOPSIS + + use Web::Request; + + my $app = sub { + my ($env) = @_; + my $req = Web::Request->new_from_env($env); + my $upload = $req->uploads->{avatar}; + }; + +=head1 DESCRIPTION + +=cut + has headers => ( is => 'ro', isa => 'Web::Request::Types::HTTP::Headers', @@ -50,4 +65,33 @@ has basename => ( __PACKAGE__->meta->make_immutable; no Moose; +=method headers + +Returns an L<HTTP::Headers> object containing the headers specific to this +upload. + +=method content_type + +Returns the MIME type of the uploaded file. Corresponds to the C<Content-Type> +header. + +=method tempname + +Returns the local on-disk filename where the uploaded file was saved. + +=method size + +Returns the size of the uploaded file. + +=method filename + +Returns the preferred filename of the uploaded file. + +=method basename + +Returns the filename portion of C<filename>, with all directory components +stripped. + +=cut + 1; |