AJAX Upload progress monitor for Commons-FileUpload Example
Don’t laugh .. I did not get any comments from my previous post (normal, nobody reads this blog except me
), so I decided to take the time to put together a little sample of a Java AJAX file upload progress bar example.
For people who never used DWR, it can also serve as a nice example of how simple it is to use.
The example has been kept to the strict minimum to be self explanatory and it not supposed to be used as is .. (java code is a JSP aarrrggg …).
I also added a delay during the upload so that you get a chance to actually see the progress bar move when the server and the client are on the same machine.
[code lang="java"]UploadListener listener = new UploadListener(request, 30);[/code]
To run the example, just place the war file in your favorite servlet engine’s deployment dir.
Here is a screenshot of the example in action :

Here is the war file : ajax-upload-1.0.war (the war includes all sources and a build file)
And remember, this is an example to demonstrate and understand how all this works and is not supposed to be used as is.
P.


