How can we set the limit on the number of files in the file upload feature in Mendix?

0
Hello Expert's, Greetings, I have an input form with a file upload feature where we can upload JPG, PDF, and PNG files, and it is working properly. But the problem is, I can upload as many files as I want, and all of them are getting uploaded. So, I need to set a limit so that only 5 files can be uploaded, how can I achieve this , any help or suggestions please .
asked
2 answers
0
  • image.png

 

addtional info 

answered
0

You can create a new entity with name for example "UploadedFile". Each time you add a new file you can create a new "UploadedFile" object. Then when you can add a validation in your "Submit" microflow. In the validation, you can retrieve these "UploadedFile" objects and count them. Then add a decision: "Count > 5? " If true, then you can display a message to the user that they can't add more than 5 files and end the microflow without saving it. User will only be able to attach max. of 5 files this way. 

 

I hope this helps.

answered