Skip to main content
OutSystems

How to validate file input on a File Upload widget

Question

How do I validate if the user selected a file on fileUploadWidget in a web application?

Answer

On the action that processes the file upload, check if the Filename property is not empty.

If the user does not upload a file, the example below provides a feedback message and interrupts the process.

file upload.png

Unlike other widgets, the File Upload Widget doesn't have Valid or Validation Message properties. Check the Filename property instead.