I found one solution. It's not very elegant but seems to do right things. Cancel button executes removeFromParent() for panel that contains FileUpload and FormPanel and replace that with new one. This generates exception on server side but also stops uploading file.
On 19 joulu, 15:51, "olivier FRESSE" <[email protected]> wrote: > I'm afraid you can't do that beacause of the JS security restriction... > Except by clicking on the "Stop" button of the browser > > 2008/12/19 jazzka <[email protected]> > > > > > Is there any good ways to cancel file uploading from client side. I am > > using FileUpload with FormPanel and when the user open file from > > "Choose file" dialog it's automaticly start loading file to server > > side. If the file is really big and user have low upstream the loading > > will take too much time and I want offer cancel functionality. > > > // fileUpload onEvent > > public void onEvent(Event event) > > { > > String file = fileUpload.getFilename(); > > if(!file.equals("")) > > { > > > formPanel.submit(); > > > } > > > } > > > // FormPanel onSubmit > > public void onSubmit(FormSubmitEvent event) > > { > > // Show loading and Cancel now > > } > > > public void onSubmitComplete(FormSubmitCompleteEvent event) > > { > > // Hide loading and Cancel and show ok if success > > } > > > How can I cancel form submission/file uploading? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
