For FileUploadField or FileMultiUploadField, how to override their behavior so that they do not automatically upload and save the file/s to the database? I would like to add a button that when clicked does the actual upload. What happens right now is it automatically uploads the file just by selecting it from the file explorer. I tried to add fileStoragePutMode="MANUAL" to no avail.
fileStoragePutMode - defines how the file and the corresponding FileDescriptor are stored.
In the IMMEDIATE mode it is done right after uploading file to the temporary storage of the client tier.
In the MANUAL mode, you should do it programmatically in a FileUploadSucceedListener.
So, if you define fileStoragePutMode="MANUAL", then a file is uploaded only into temporal storage and isn’t stored in a DB. You can an additional button to put a file into storage. Also, you can remove a temporal file if another one is selected by using com.haulmont.cuba.gui.upload.FileUploadingAPI#deleteFile.
I managed to add a button that transfers the file from temporary storage to file storage, and now, is there are way to reset or re-initialize the FileUploadField after a successful upload? If possible remove the file name displayed on the screen? Something like this.