The FileMultiUploadField component allows you to upload files to the temporary storage. After that, you can process them as File objects in the server file system or move to the file storage.

When you click on a button, a standard OS file picker window appears, where you can select multiple files for upload.

file multi upload field

Component’s XML-name: fileMultiUpload.


Usage example:

Declare the component in the XML screen descriptor:

<fileMultiUpload id="fileMultiUploadField"
private FileMultiUploadField fileMultiUploadField;
private TemporaryStorage temporaryStorage;
private Notifications notifications;

public void onInit(InitEvent event) {
    fileMultiUploadField.addQueueUploadCompleteListener(queueUploadCompleteEvent -> { (3)
        for (Map.Entry<UUID, String> entry : fileMultiUploadField.getUploadsMap().entrySet()) { (4)
            UUID fileId = entry.getKey();
            String fileName = entry.getValue();
            FileRef fileRef = temporaryStorage.putFileIntoStorage(fileId, fileName); (5)
                .withCaption("Uploaded files: " + fileMultiUploadField.getUploadsMap().values())
        fileMultiUploadField.clearUploads(); (6)
    fileMultiUploadField.addFileUploadErrorListener(queueFileUploadErrorEvent ->
                    .withCaption("File upload error")
1 In the screen controller, define the component itself and the TemporaryStorage interface.
2 In the onInit() method, add listeners which will react to successful uploads and errors.
3 The component uploads all selected files to the temporary storage and invokes the listener added by the addQueueUploadCompleteListener() method.
4 In this listener, invoke the FileMultiUploadField.getUploadsMap() method to obtain a map of temporary storage file identifiers to file names.
5 Then, corresponding FileRef objects are created by calling TemporaryStorage.putFileIntoStorage() for each map entry. Also, this method is used to move the uploaded file from the temporary storage to FileStorage.
6 After processing, you should clear the list of files by calling the clearUploads() method to prepare for further uploads.


The FileMultiUploadField component has the following listeners, described in the FileStorageUploadField component:


The FileMultiUploadField component has the following attributes, described in the FileStorageUploadField component:


  • getUploadsMap() - returns Map of file ids in TemporaryStorage to file names.

  • clearUploads() - clears the list of uploaded files.