Multiple file upload best practice?

555 views
Skip to first unread message

Matthew McLarty

unread,
Mar 28, 2017, 10:25:40 AM3/28/17
to GWT Users
Hello,

I currently have a project that's using the gwtupload component. I'm fairly happy with it except that it does not provide a way to remove a file once it has been uploaded when using its MultiUploader. It only provides a mechanism to remove a file when you use its SingleUploader.

I've posted to the Google group requesting support but it appears the project is no longer being supported.

Because the project appears to be dead, I'm asking here for advice on what the current best practice is for handling uploads of multiple files in GWT. It seems like using GWT's FileUpload and setting the element's "multiple" property is the better way to go. Any advice would be greatly appreciated.

Thomas Broyer

unread,
Mar 28, 2017, 1:31:44 PM3/28/17
to GWT Users
I think a best practice nowadays would be to use an <input type=file> (which you can hide and "trigger" with .click() when clicking on, say, a button; this is only "cosmetic" though) and XMLHttpRequest advanced features (sending a File object, or possibly a FormData if that's what your server expects; using progress events to track upload).
That requires using JSNI or JsInterop in GWT though.
(note: we've actually been using this for 6 years or so, on an intranet app targeting Firefox ESR; but browser support is much broader nowadays: http://caniuse.com/#feat=xhr2 )

Matthew McLarty

unread,
Mar 28, 2017, 3:40:19 PM3/28/17
to GWT Users
Thanks, Thomas.

I am going to ditch the third-party library in favor of the GWT FileUpload and set its "multiple" attribute so user's can upload multiple files. Seems like it will be much cleaner this way anyway.
Reply all
Reply to author
Forward
0 new messages