PDA

View Full Version : Using a ProgressBar with FileUpload



EagleEye666666
18 Jan 2009, 4:32 PM
Hej guys,

some question. I would like to let the user know how the upload is going, cuz in my WebApp the size of the uploaded files could be quite big. There is any chance to solve such issue?

I can't find a way.

A FormPanel only offers:

BeforeSubmit : FormEvent(this)
Fires before the form is submitted. Only applies when using HTML submits. Listeners can set the doit field to false to cancel the action.

* formPanel : this

Submit : FormEvent(this, resultHtml)
Fires after the form has been submitted. Only applies when using HTML submits.

* formPanel : this
* resultHtml : the response html

So there is no anyway to let the client recieve some response from the server regarding to the upload progress? Serverside coding i have done so far. Even some JSON Response...

Iam using Commons FileUpload with it's ProgressListener, so from the serverside it would be possible. I can't see a way on clientside to recieve sth from server :(

Any Ideas ?? I would be really grateful about some discussion.
Have a good start of the week guys! :)

gslender
19 Jan 2009, 2:49 PM
I think most methods poll the server asking how much of the total has been recieved etc.. so its a combination of server side knowing the amount transferred, sending back the results etc and the client side updating a progress bar.

I could be wrong, but I believe that is the common method used to give feedback like this...

EagleEye666666
19 Jan 2009, 4:03 PM
I think most methods poll the server asking how much of the total has been recieved etc.. so its a combination of server side knowing the amount transferred, sending back the results etc and the client side updating a progress bar.

I could be wrong, but I believe that is the common method used to give feedback like this...

Hmm but i cant use extra or new html requests to the same controller(using spring). I mean the serverside i have go a listener on the upload proccess. But how to implement client side to recieve this response? I will than need a new request for it or iam wrong?

Thats why i said a clientside component like the http://max-bazhenov.com/dev/upload-dialog-2.0/index.php this would be really nice. :D but as u can see here is also not a constant feedback how the concrete progress of one file is.

Damn difficult :( (iam not happy with the (i have changed flextable to gxt table) table iam not satisfied with the solution.)

Uploading sth is working .. but i have to add state stuff etc.... damn it is a hell of crazy implementing... (iam ed up right now)

gslender
19 Jan 2009, 4:08 PM
there is no way to ask the browser how many bytes have been sent. that is why accurate methods poll the server for the amount sent.

other option is to just show a busy progress bar that just continues to update without ever ending - and at least this would be a feedback to the user ?

EagleEye666666
20 Jan 2009, 3:56 AM
yeah i agree. maybe i will try to open this fileupload within a dialog.

I wasted some time to accomplish this func. what this dialog has... when clicking Add directly opening file input..., but it is hell of complicated stuff and i do not know enough about the underlaying JS :/ I tried to inherit Button set Type to file... and added properties like this uploaddialog there has in JS code. Iam not able to understand all of the JS methods of this button :(

I give it up.