原文地址:http://www.telio.be/blog/2006/01/06/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.
To run the example, just place the war file in your favorite servlet engine’s deployment dir.
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.
UploadListener listener = new UploadListener(request, 30);
To run the example, just place the war file in your favorite servlet engine’s deployment dir.