help for multifileupload...

Gentlemen, please, I want to use the add on multifileupload. But I do not know how to set the target folder of uploaded files. Anyone ever used this component or know how to set the target folder?
Thank you. a hug

My friends help me … lol … I need to use this add on to upload multiple files. One tip, please …
a hug

You have to implement the
handleFile(InputStream stream, String fileName, String mimeType, long length)
method of the UploadFinishedHandler interface. This method will run only when the upload finished successfully. You have the InputStream as a parameter which contains the data of the uploaded file. You have to decide what to do with the file (store it in filesystem or database or just in memory). Here is an example if you would like to save as a file to the file system:

new UploadFinishedHandler() {
@Override
public void handleFile(InputStream stream, String fileName, String mimeType, long length) {
try {
FileOutputStream fos = new FileOutputStream(new File(“/home/user/test/” + fileName));
fos.write(IOUtils.toByteArray(stream));
} catch (IOException ex) {
ex.printStackTrace();
}
}
};

Make sure that the folder exists and you have permission to write in it.
You have to pass this implementation to the constructor of MultiFileUpload.

Gergely, in advance, thank you for your attention. Monday I will try to implement your solution. Thank you very much for the help.
Hugs.

Hello,
I have a question concerning the MultiFileUpload. I would like to set a maximum size of files to upload, and I do not know how to do it.

Thank you for your support

In version 1.1 you can do it by invoking method
setMaxFileSize(int maxFileSizeInBytes)
in class MultiFileUpload.

Perfect! worked! Thanks again. The only thing to complain about is the fact that the component does not work with chrome or mozilla. Only with IE 9. But thank you for your help.
A hug

Hello, gel. Now the component works fine on single upload. But I can not select more than one file. I hold the CTRL key and click on the file name but I can only select one at a time. Could you help me?
Use the Vaadin version 7.1.1 and have compiled using CTRL + 6.
a hug

You should update your browser. Chrome and Firefox is supported for multiple upload if it’s version supports HTML5. In IE and other browser which not supported, the addon works like a single upload.
Anyway you have to pass true to the 3rd parameter of MultiFileUpload constructor.

Hello Gergely. Please see if you can help me. Using the add on multifileupload in IE9, I see control of multi files. But I can only select one file at a time. In Chrome 28.0.1500.95 me in Firefox 23.0.1, I do not see the control and get this message: "Widgetset does not contain implemetation is com.wcs.wcslib.vaadin.widget.multifileupload.component.MultiUpload. Check its connector component’s @ Connect mapping, widgetsets GWT module description file and re-compile your widgetset. "
But I have already compiled the component and keep getting this msg.
In single upload, everything OK.
Could you help me solve this?
Thank you.
a hug

rs … My mistake was so basic that no one was interested in answering … rs … But as always have a friend with the same question, leave the answer here:
it MUST be in web.xml:

widgetset package.widgetset.WidgetsetName

Detail in Chapter 4.8 of the book Vaadin:
<! - If not using the default widget set →

widgetset </ param-name>
com.ex.myprj.MyWidgetSet </ param-value>
</ init-param>

a hugs

Dear Gergely Juhasz, please, how can I know when the MultiFileUpload finishes sending the files?
I need to populate a list of uploaded files.
Thank you in advance.

Is the
setMaxFileSize(int maxFileSizeInBytes)
function removed? How can I achieve that in the current version?

I need an upload dialog, where the user can choose (multiple) files and then not immediately upload them but display the filenames in a list. The user should then be able to modify the file list (delete files from list, add files to list). At the end with a click an a button all files should be uploaded at once. Has anyone an idea how to do this with this add on?

Thank you in advance.

File upload works fine, but when the page is closed, upload status dialog is shown with the caption “Upload Status (0%)” and pop up a confirm dialog that caption is “This will cause ALL uploads to be interrupted. Are you sure?” and uploads cannot be interrupted. How can i ignore this confirm and that upload dialog.

Thank you in advance.
21501.png

Hi, which class should I call to use this component? I see there’s the “Upload” class but I don’t know which class is for this add-on.

Help would be really appreciated.
Thanks in advance!

Hello,

Is there any documentation about multifileupload addon? I only find the main page: https://vaadin.com/directory/component/multifileupload#

Thanks in advance.