In my ongoing efforts in restructuring the core of lighttpd for the 1.5.0 release I brought mod_uploadprogress back to life.
I talked about mod_uploadprogress a long time ago and since then I got at least one request per month to bring it back again.
It was changed abit since the early days. Instead of XML we send out JSON now. That does the same and easier to parse:
{ 'state' : 'starting' };
...
{ 'state' : 'uploading', 'size' : 87901150, 'received' : 80601372};
{ 'state' : 'done', 'size' : 87901150, 'received' : 87901150};
First you need a file-upload form. It is all standard and only calls our upload-progress updater onSubmit.
The progress bar in this case are 2 nested div-tags:
Some Javascript with XMLHTTPRequest can tell us about the state of a upload:
Now I only have to commit this code to SVN and make a pre-release :)