commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Courcoux <>
Subject Re: Adding a status callback to FileUpload
Date Mon, 29 Mar 2004 19:58:00 GMT

There is some stuff in bugzilla regarding Upload Progress Reporting
which supports a component I wrote to work with Turbine.

I think I left some unneeded synchronization in, which was kindly
pointed out by someone and there was also a useful additional method
suggested, from memory it was to do with getting the start time of the

Perhaps this would work for you. I know several users who have taken my
basic code, amended it and used it with both Struts and Turbine.

Maybe we could get this polished and accepted.



On Mon, 2004-03-29 at 20:45, Karl Goldstein wrote:
> Hi,
> I plan to try to add a status callback to the FileUpload package.  Here 
> is the scenario I would like to support (I'm making this up as I go, but 
> something like this):
> 1) User uploads a large file (form target is an invisible IFRAME so that 
> the browser does not leave the form page on submit).
> 2) The onsubmit handler for the file upload form uses setTimeout to call 
> a "checkStatus" function (in Javascript) in a few seconds.
> 3) The checkStatus function makes a request in an invisible IFRAME to 
> the server.
> 4) The server responds with with a message on the status of the file upload.
> 5) Upon receiving a reply from the server, an onload handler in the 
> IFRAME updates a visible status message on the form.
> 6) When the upload is complete, the onload handler displays a success 
> message and moves the user to the next page (or displays an error).
> To support this scenario, I plan to try and add the following to FileUpload:
> 1) As FileUpload processes an incoming request, it updates a session 
> attribute associated with the request.  I'm assuming in most cases it 
> should be possible to provide a percentage complete status, since the 
> total size is available in the header even before the upload is complete.
> 2) A status page returned to the invisible IFRAME can check this session 
> attribute and inform the client what FileUpload is doing at the moment.
> Anybody thought of doing something similar?  Any thoughts on why this 
> wouldn't work?  Thanks for any feedback, and unless I hear otherwise 
> I'll take a shot and let you know if/when I come up with something.
> Regards,
> Karl Goldstein
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message