- Table of contents
- Module mod_uploadprogress
string, empty by default; use "/progress" (or something else) to enable the module
integer, default: 60 seconds
boolean, default: "disable"
upload-progress.progress-url = "/progress" upload-progress.remove-timeout = 30 upload-progress.debug = "enable"
This module will not work if you are using more than one worker ("server.max-worker":Server.max-workerDetails)
This module can be used to track the progress of a current upload.
When a file upload is done, the current received bytes are tracked
with this module and can be retrieved via the progress-url and the
tracking key. This key has to be added to the upload url or via
In combination with server.max-request-size, usually the browser
will display an error page containing information that the connection
has been terminated. This can not be replaced with a custom error
page, the browsers aren't displaying them.
The uploadprogress module tracks this errors now. If the upload
is done in one window (or an iframe which will be hidden on form submit),
another iframe can display a custom uploadprogress page which can
also fetch the status 413 via json if this happen. If 413 is retrieved,
a custom error message (File is too big) can be displayed.
The first examples can be found at
The mentioned multi-frame example will be added in the future.
How to use it¶
Generate a progress-id (32 hex digits - just use a md5 hash); send this progress-id in the upload request and in all progress requests, either as "X-Progress-ID" header or as "X-Progress-ID" query string parameter.
JSON Response¶The returned json may contain:
current state of upload
values = starting, error, done, uploading
http error status
values = 413
size of request
bytes received by lighttpd yet
Three html-files are appended as example, based on Jan's work mentioned
at the link above. You need to add the tracking_id (an example how this is
In the iframe version, you can generate the tracking_id via php or other
Warning, the files are not working out of the box, you have to change things!Downloads:
- index.html - main page
- status.html - page containing progress
- upload.html - page posting the file
Theres a new example (using YUI framework) here:
mod_uploadprogress for lighttpd-1.4 branch¶
I've backported mod_uploadprogress so you may use it together with lighttpd-1.4 branch if interested. You may download the patch at http://labs.logic.cz/patches/lighttpd/1.4.x/
Don't expect exactly the same behavior as this version returns JSON object for better integration with frameworks like Dojo. I've also tweaked the key names and some values returned.
We're using this patch for about half a year and it seems stable. Enjoy! ;-)
Updated by gstrauss almost 2 years ago · 16 revisions