Page 1 of 1
How to cancel file upload
PostPosted:Fri Dec 05, 2014 8:06 am
by mohasinmujawar56
I am using OpenKM 6.3 and have downloaded source code from svn. I want to add an option in File upload form for cancelling the upload. Is it possible to cancel the file upload? If yes can you please elaborate on this with some example. Because as I am seeing in source code and understanding it, you are passing and setting many events at the time of uploading. So if possible can you please explain with example like code or something?
Re: How to cancel file upload
PostPosted:Mon Dec 08, 2014 7:55 am
by Catscratch
Can't you simple hit the refresh button in the browser? This should cancel the upload.
Re: How to cancel file upload
PostPosted:Mon Dec 08, 2014 9:21 am
by mohasinmujawar56
This option is good. But what I needed is to give a button that will cancel the upload. For that I need some sample code.
Re: How to cancel file upload
PostPosted:Wed Dec 10, 2014 5:37 pm
by jllort
The change should be done in FancyFileUpload and in some way destroy the post what has been done. Any patch on this direction will be wellcome.
Re: How to cancel file upload
PostPosted:Tue Dec 16, 2014 7:58 am
by mohasinmujawar56
I have tried many things like setting the widgetState to Empty State on click of Cancel button but it was not working. Then I tried to close ffUpload and remove all pending files from queue if any, not worked. Didn't get any solution for this. Can anyone please give some ideas to do so?
Re: How to cancel file upload
PostPosted:Wed Dec 17, 2014 9:43 pm
by jllort
Take a look you're submiting a form. The idea will be destroy this form what you're submitting and reset some vars to continue with next form.
fileupload var is a FormPanel ( take a look into the class )
Code: Select allpublic class FormPanel extends SimplePanel implements FiresFormEvents, FormPanelImplHost {
Seems FormPanel is marked as deprecated by GWT and replaced by FileUpload. Here I see two possibilities ( extends actual FormPanel or investigate if it's possible doing with FileUpload, I suggest some sample in both cases before trying to change openkm code).