How can we enable/disable save button based on the type of file selected in Image Uploader?

We have created a page which contains Image Uploader widget, title, description fields and save, cancel button. We want to disable save button if file with invalid extension is uploaded.
1 answers

File uploader has 'Allowed extensions'.


The file uploader has no OnChange event handler. So the only thing you can do is check the extension in the save microflow.


Another option is to place the name below the file uploader and do the check in the OnEnter microflow. To disable the microflow you need either dynamic classes or an extra boolean.


You can also add a dynamic class to the save button


if $currentObject/Name != empty and endsWith($currentObject/Name, '.xlsx') then 'disabled' else 'enabled'


but this is also no triggered at the right time. I would handle it in the save microflow.