Apache-UploadMeter

 view release on metacpan or  search on metacpan

javascript.pod  view on Meta::CPAN

The parameters contain the following information:

=over

=item *
meter_id

Contains the meter_id for the current upload

=item *
filename

Contains the filename (as supplied by the client) of the currently uploading file

=item *
finished

Contains a boolean value which will be set to 1 once the upload is complete

=item *
status

=over

=item *
timestamp

Current timestamp from server, as seconds since the epoch

=item * 
start

Timestamp (as seconds since the epoch) when upload was started

=item *
received

Number of bytes received so far

=item *
total

Total number of bytes in the upload (more accurately, of the upload B<request>
including other form information)

=back

=item *
total

This is a shortcut for C<status.total>

=item *
seen

This is a shortcut for C<status.received>

=item *
progress

A value between 0 and 100, representing the percentage of the upload that has
been completed.

=item *
currentrate

The approximate current upload rate (in bytes/second)

=item *
elapsed

The time (in seconds) which has elapsed since the upload started

=item *
remaining

The approximate time (in seconds) remaining in the upload

=back

The callbacks currently available are:

=over

=item *
onCreate(I<>)

This callback is called once just before the first AJAX call is made.  As such,
it doesn't happen on construction; it happens after um.start(), but before the
initial AJAX request is made.  I know it's not really well named, but you're
welcom to suggest something better.

=item *
onInitialize(I<status>, I<last>)

This callback is called once after the initial AJAX response is received and
parsed.  While I<last> is generally useless at this point (it's a subset of
I<status> right now), it's provided in case you want to change the value of
anything in it.

=item *
onUpdate(I<status>, I<last>)

This callback is called every time data is updated from meter URL.  It can be
utilized to update other GUI elements, such as is done in the default pop-up.

=item *
onFinished(I<status>, I<last>)

This callback is called after onUpdate if the upload is determined to be complete
(eg, C<tatus.finished == 1>)

=back

=back

=back

=head3 UploadMeter.Responders

In addition to adding handlers to individual UploadMeter objects, as described



( run in 1.966 second using v1.01-cache-2.11-cpan-39bf76dae61 )