NAME

Apache2::ASP::UploadHookArgs - Argument for UploadHook instances

SYNOPSIS

my $Upload = Apache2::ASP::UploadHookArgs->new(
  upload              => $upload, # An APR::Request::Param::Table object
  percent_complete    => $percent_complete,
  elapsed_time        => $elapsed_time,        # in seconds
  total_expected_time => $total_expected_time, # in seconds
  time_remaining      => $time_remaining,      # in seconds
  length_received     => $length_received,     # in bytes
  data                => defined($data) ? $data : undef,  # bytes received in this "chunk"
);

DESCRIPTION

Rather than just passing a hashref as an argument, this class serves to enforce some structure to the whole Apache2::ASP upload model.

METHODS

new( %args )

%args should be as shown in the synopsis above.

upload( )

Returns an APR::Request::Param::Table object.

percent_complete( )

Returns a float representing what percent of the upload has been received so far.

elapsed_time( )

Returns the number of seconds since the upload began.

total_expected_time( )

Returns the total number of seconds we expect the upload to last.

time_remaining( )

Returns the number of seconds the upload will continue after this point in time.

length_received( )

Returns the number of bytes we have received from the upload so far.

content_length( )

Returns the value of $ENV{CONTENT_LENGTH} at this point, but may be updated later, based on usage and requirements.

data( )

Returns the bytes received in this "chunk" of the upload.

AFTER THE UPLOAD HAS FINISHED

After the upload has finished, you can count on the following methods returning actual values:

new_file( )

Returns the filename of the new file, as it was in the upload form field.

Example: C:\Documents\MyFile.txt

filename_only( )

Returns something like MyFile.txt

Returns something like /media/MyFile.txt

BUGS

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.

HOMEPAGE

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR

John Drago mailto:jdrago_999@yahoo.com

COPYRIGHT AND LICENSE

Copyright 2007 John Drago, All rights reserved.

This software is free software. It may be used and distributed under the same terms as Perl itself.