יצחק גולדסטנד > Apache-UploadMeter-0.9915 > Apache::UploadMeter

Download:
Apache-UploadMeter-0.9915.tar.gz

Dependencies

Annotate this POD

Related Modules

CGI::Application
Apache::Request
more...
By perlmonks.org
View/Report Bugs
Module Version: 0.9915   Source  

NAME ^

Apache::UploadMeter - Apache module which implements an upload meter for form-based uploads

SYNOPSIS ^

XML-based graphical meter (in httpd.conf)

  PerlLoadModule Apache::UploadMeter
  <UploadMeter MyUploadMeter>
      UploadForm    /form.html
      UploadHandler /perl/upload
      UploadMeter   /perl/meter
      MeterType     XML
  </UploadMeter>

  (in /form.html)
  <!--#uploadform-->
  <INPUT TYPE="FILE" NAME="theFile"/>
  <INPUT TYPE="SUBMIT"/>
  </FORM>

Web 2.0 JS-based graphical meter (in httpd.conf)

  PerlLoadModule Apache::UploadMeter
  <UploadMeter MyUploadMeter>
      UploadForm    /form.html
      UploadHandler /perl/upload
      UploadMeter   /perl/meter
      MeterType     JSON
  </UploadMeter>

  (in /form.html)
  <FORM ACTION="/perl/upload" ENCTYPE="multipart/form-data" METHOD="POST" class="uploadform">
  <INPUT TYPE="FILE" NAME="theFile"/>
  <INPUT TYPE="SUBMIT"/>
  </FORM>
  
  <DIV class="uploadmeter"></DIV>

ONLINE DEMO ^

An online demo of a (fairly) up-to-date version of the progress meter can be seen at http://uploaddemo.beamartyr.net/ [To conserve bandwidth, this URL won't allow more than 5MB of uploaded data. An attempt to upload more than that will cause the upload to be prematurely canceled, so try to ensure the total size of the files to be uploaded there is less than 5MB]

DESCRIPTION ^

Apache::UploadMeter is a mod_perl module which implements a status-meter/progress-bar to show realtime progress of uploads done using a form with enctype=multipart/form-data.

The software includes several built-in DHTML widgets to display the progress bar out-of-the box, or alternatively you can create your own custom widgets.

To use the enclosed JavaScript powered widget, simply modify the <form> tag to include class="uploadform".

To use the XML/XSL powered widget, simply replace the existing opening <FORM> tag, with the a special directive <!--#uploadform-->.

NOTE: To use this module, mod_perl MUST be built with StackedHandlers enabled.

CONFIGURATION ^

Configuration is done in httpd.conf using <UploadMeter> sections which contain the URLs needed to manipulate each meter. Currently multiple meters are supported with the drawback that they must use distinct URLs (eg, you can't have 2 meters with the same UploadMeter path).

DATA FORMAT ^

Apache::UploadMeter currently provides 2 types of meters: JavaScript (JSON) based, and XML-based. The JSON is the new default; it's sexier, slicker, works out-of-the-box with modern browsers, and with the magic of AJAX and DHTML, doesn't even need a popup window. XML is also still actively supported and is aimed at users who wish to further customize the user-experience or provide a non-browser based UploadMeter. Both JSON and XML provide identical data; a formal XSL schema can be seen at http://uploaddemo.beamartyr.net/demo/xml/meter/styles/xml/aum.xsd

BUILT-IN TYPES ^

Apache::UploadMeter comes pre-bundled with 2 DHTML-based graphical meters that can be used as-is, or just as reference points for builing your own custom meters. Currently the 2 types can be selected by specifying JSON or XML in the MeterType configuration directive. Each of these will cause Apache::UploadMeter to add relevant code to your upload form page.

CUSTOMIZATION ^

Additionally, NONE can be specified, which will allow you to customize your user-experience without using any of the built-in meters. To use this, you must define your own widget, and query the UploadMeter URL on your own.

The UploadMeter currently accepts the following parameter:

COMPATIBILITY ^

Beginning from version 0.99_01, this module is only compatible with Apache2/mod_perl2 Support for Apache 1.3.x is discontinued, as it's too damn complicated to configure in Apache 1.3.x This may change in the future, but I doubt it; servers are slowly but surely migrating from 1.3 to 2.x Maybe it's finally time for you to upgrade too.

AUTHOR AND COPYRIGHT ^

Copyright (c) 2001-2007 Issac Goldstand <margol@beamartyr.net> - All rights reserved.

This library is free software. It can be redistributed and/or modified under the same terms as Perl itself.

This software contains third-party components licensed under BSD and MIT style open-source licenses.

SEE ALSO ^

Apache2::Request(3)

syntax highlighting: