Unique validation in File Dropper

0
I have used File dropper widget in my application to take different kinds of multiple files into my application. It’s working fine but it is taking the same files multiple times. I want that it should not take same file not more than once(Unique Validation).
asked
2 answers
0

To prevent the File Dropper widget in Mendix from accepting the same file more than once, you can add a client-side validation function to check if the file has already been selected.

You could for example use a microflow which calls a javascript function which checks if each file in the list of selected files already exists in the list of files currently being uploaded. If a duplicate file is found, the function could return an error message.

answered
0

I’m not sure what your case is but if you mean how can I cover the process of uploading the same file twice on the same form, that works out of the box if I recall correctly.

 

If you want to check on files that are already uploaded in earlier sessions and/or other forms than you can do that by building a validation. Create a validation on for example the combination of name (Name) and filesize (Size), this can be done by retrieving the FileDocument with the to be uploaded Name and Size of the file. If you have a result then your file is already within your application.

answered