=head1 NAME
-Catalyst::Request::Upload - Catalyst Request Upload Class
+Catalyst::Request::Upload - handles file upload requests
=head1 SYNOPSIS
- $upload->copy_to
- $upload->fh
+ $upload->copy_to;
+ $upload->fh;
$upload->filename;
$upload->headers;
$upload->link_to;
=head1 DESCRIPTION
-This is the Catalyst Request Upload class, which provides a set of accessors
-to the upload data.
+This class provides accessors and methods to handle client upload requests.
=head1 METHODS
-=over 4
+=head2 $upload->new
-=item $upload->new
+Simple constructor.
-simple constructor.
+=head2 $upload->copy_to
-=item $upload->copy_to
-
-Copies tempname using C<File::Copy>. Returns true for success, false otherwise.
+Copies the temporary file using L<File::Copy>. Returns true for success,
+false for failure.
$upload->copy_to('/path/to/target');
return File::Copy::copy( $self->tempname, @_ );
}
-=item $upload->fh
+=head2 $upload->fh
-Opens tempname and returns a C<IO::File> handle.
+Opens a temporary file (see tempname below) and returns an L<IO::File> handle.
=cut
return $fh;
}
-=item $upload->filename
+=head2 $upload->filename
-Contains client supplied filename.
+Returns the client-supplied filename.
-=item $upload->headers
+=head2 $upload->headers
-Returns a C<HTTP::Headers> object.
+Returns an L<HTTP::Headers> object for the request.
-=item $upload->link_to
+=head2 $upload->link_to
-Creates a hard link to the tempname. Returns true for success,
-false otherwise.
+Creates a hard link to the temporary file. Returns true for success,
+false for failure.
$upload->link_to('/path/to/target');
return CORE::link( $self->tempname, $target );
}
-=item $upload->size
+=head2 $upload->size
-Contains size of the file in bytes.
+Returns the size of the uploaded file in bytes.
-=item $upload->slurp
+=head2 $upload->slurp
-Returns a scalar containing contents of tempname.
+Returns a scalar containing the contents of the temporary file.
=cut
return $content;
}
-=item $upload->tempname
-
-Contains path to the temporary spool file.
+=head2 $upload->tempname
-=item $upload->type
+Returns the path to the temporary file.
-Contains client supplied Content-Type.
+=head2 $upload->type
-=back
+Returns the client-supplied Content-Type.
-=head1 AUTHOR
+=head1 AUTHORS
Sebastian Riedel, C<sri@cpan.org>
+
Christian Hansen, C<ch@ngmedia.com>
=head1 COPYRIGHT