Apache2-UploadProgress
view release on metacpan or search on metacpan
0.2 2006-04-23 23:36
- Simplified the usage to the point of only needing to call
one js function from an onsubmit handler in the upload form
- All support files (js/css/xsl) are automatically Aliased in
Apache, to the /UploadProgress location (can be altered using
UploadProgressBaseURI directive in Apache, if you want to
customize the js/css/xsl files)
- Simplified Apache configuration by automatically setuping the
content handler that provides progress updates to
/UpdateProgress in Apache
- include an XSL stylesheet to render XML doc in a popup (will
automatically fall back to plain HTML if XSL transforms not
supported by browser)
- Added a public method to register new mime handlers, ->register_mime
- remove the need for prototype.js from the examples to cut down the
size of the js support code needed
0.1 2006-04-10 13:40
- Initial version
Build.PL
Changes
examples/css/progress_bluebar.css
examples/css/progress_blueblock.css
examples/embedded.cgi
examples/popup.cgi
extra/progress.css
extra/progress.js
extra/progress.jmpl
extra/progress.jmpl.js
extra/progress.xsd
extra/progress.xsl
lib/Apache2/UploadProgress.pm
Makefile.PL
MANIFEST This list of files
META.yml
DESCRIPTION
This module allows you to track the progress of a file upload in order
to provide a user with realtime updates on the progress of their file
upload.
The information that is provided by this module is very basic. It just
includes the total size of the upload, and the current number of bytes
that have been received. However, this information is sufficient to
display lots of information about the upload to the user. At it's
simplest, you can trigger a popup window that will automatically refresh
until the upload completes. However, popups can be a problem sometimes,
so it is also possible to embed a progress monitor directly into the
page using some JavaScript and AJAX calls. Examples using both
techniques are discussed below in the EXAMPLES section.
EXAMPLES
Simple Popup Upload Monitor
The simplest way to add a progress monitor to your forms is to use the
popup technique. This will launch a popup window with a progress monitor
that will automatically refresh until the upload is complete. The popup
will use the XML method by default, and format the page using an
included XSL stylesheet (which can be customized to suit your needs). If
the browser does not support XML transformations, then content
negotiation will automatically fall back on a basic HTML page.
Here is what you need to do to get the popup technique working:
<script src="/UploadProgress/progress.js"></script>
<form action="/cgi-bin/script.cgi"
method="post"
enctype="multipart/form-data"
onsubmit="return startPopupProgressBar(this, {width : 500, height : 400})">
<input type="file" name="file"/>
<input type="submit" name=".submit"/>
</form>
customize them to suit your needs.
UploadProgressBaseURI /CustomUploadProgess
Alias /CustomUploadProgess /var/www/customprogressfiles
Make sure that you copy all the support files found in the 'extra'
directory to this new location and then you can customize them to
your liking.
This currently only affects the urls used in the XML/XSL and HTML
mime handlers used in the popup progress monitor.
HANDLERS
handler
This handler should be run at the PerlPostReadRequestHandler stage,
and will detect whether we need to track the upload progress of the
current request. There are 5 ways for the handler to determine if
the upload progress should be tracked:
X-Upload-ID
There is an incoming header called X-Upload-ID which contains
lib/Apache2/UploadProgress.pm view on Meta::CPAN
=head1 DESCRIPTION
This module allows you to track the progress of a file upload in order
to provide a user with realtime updates on the progress of their file
upload.
The information that is provided by this module is very basic. It just
includes the total size of the upload, and the current number of bytes that
have been received. However, this information is sufficient to display lots of
information about the upload to the user. At it's simplest, you can trigger a
popup window that will automatically refresh until the upload completes.
However, popups can be a problem sometimes, so it is also possible to embed a
progress monitor directly into the page using some JavaScript and AJAX calls.
Examples using both techniques are discussed below in the EXAMPLES section.
=head1 EXAMPLES
=head2 Simple Popup Upload Monitor
The simplest way to add a progress monitor to your forms is to use the popup
technique. This will launch a popup window with a progress monitor that will
automatically refresh until the upload is complete. The popup will use the XML
method by default, and format the page using an included XSL stylesheet (which
can be customized to suit your needs). If the browser does not support XML
transformations, then content negotiation will automatically fall back on a
basic HTML page.
Here is what you need to do to get the popup technique working:
<script src="/UploadProgress/progress.js"></script>
<form action="/cgi-bin/script.cgi"
method="post"
enctype="multipart/form-data"
onsubmit="return startPopupProgressBar(this, {width : 500, height : 400})">
<input type="file" name="file"/>
<input type="submit" name=".submit"/>
</form>
lib/Apache2/UploadProgress.pm view on Meta::CPAN
Change the location of the extra support files, so that you can customize them
to suit your needs.
UploadProgressBaseURI /CustomUploadProgess
Alias /CustomUploadProgess /var/www/customprogressfiles
Make sure that you copy all the support files found in the 'extra' directory to
this new location and then you can customize them to your liking.
This currently only affects the urls used in the XML/XSL and HTML mime handlers
used in the popup progress monitor.
=back
=head1 HANDLERS
=over 4
=item handler
This handler should be run at the PerlPostReadRequestHandler stage,
( run in 2.067 seconds using v1.01-cache-2.11-cpan-364913b4093 )