problems with Gwtupload

70 views
Skip to first unread message

Yossi Vainshtein

unread,
Oct 8, 2015, 10:39:59 AM10/8/15
to gwtupload
Hi

I am trying to use GwtUpload in my GWT project and have a few issues I can't get around, even after a few days of investigating and googling.

1. 

Basically, I want my users to upload files. I want both to show a button for file selection and a dropzone.
I have created an uploader:

MultiUploader uploader = new MultiUploader(FileInputType.CUSTOM.with(btnChoose).withZone(externalDropZone), myUploadManager);

the button and the dropzone automatically get the CSS styling that comes with the client bundle (all the styles that start with .GUpld). 
I _don't_ want that. I want to give them my own styling. Is there a way to disable that?


2. 

I have basically added 3 handlers to my uploader

OnChangeUploaderHandler - called when usedr selects the file(s)
OnCancelUploaderHandler - called if user decides to cancel the upload
OnFinishUploaderHandler - called when upload is finished (either succesfully or unsuccessfully)

however, sometimes it doesn't quite works as I expect it to.
In the OnChangeUploaderHandler I want to run some checks on the selected files, and if the checks fail, I call uploader.cancel() to cancel the upload (for example user has no permission etc.)

But sometimes it seems that the upload has already begun, and my canceling it halfway causes the UploadManager to display an ERROR status for the upload, as well as causing An error on the server Side:

org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly

Am I getting something wrong? is there no way to assert that the user selection is OK?

3. There seems to be a weird bug, when I use the button to upload (not dropzone), the OnChangeUploaderHandler is called twice.

Thanks
Joseph

Reply all
Reply to author
Forward
0 new messages