2

I'm working in a user interface in Java using GWT and I need to implement a component that allows the users to select multiple files and then upload all of them. I'm currently using UploadDialog from the package com.gwtextux.client.widgets.upload However I'm not able to add multiple files at once. It allows me to upload multiple files to the server but the users have to select the files one by one. Is there any way to allow the users to select multiple files using UploadDialog? is there any other alternative for this?

2 Answers 2

4

I recommend to use the gwtupload library. It allows you to select multiple files one-by-one, enqueue and send them showing a progress bar in any browser, but with the last version (0.6.7-SNAPSHOT) you can even select several files at once in the browser file dialog if you use a modern browser supporting the multiple attribute

Take a look to the gwtupload examples there are uploaders with the multiple option enabled and disabled.

Sign up to request clarification or add additional context in comments.

1 Comment

I can second the gwtupload library. I've used it to allow multiple uploads with a progress bar and it works well.
1

Without the use of an additional library you can simply subclass FileUpload and add the multiple attribute:

public class MultiFileUpload extends FileUpload { @UiConstructor public MultiFileUpload() { this.getElement().setAttribute("multiple", "multiple"); } } // Then in uiBinder: <c:MultiFileUpload name="myFiles" /> 

Or just set the attribute on a regular FileUpload

@UiField FielUpload myUpload; .... myUpload.setAttribute("multiple", "multiple"); 

2 Comments

Hmm I just tested with IE10 - seems to work... which version do you run?
@pratZ IE8 doesn't support multiple attribute. github.com/blueimp/jQuery-File-Upload/wiki/Browser-support

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.