Limiting file type on File attribute type

Hi @askelly ,

Good to hear that the banner is working :slight_smile: could be worded better, so i’ll ensure we have a bug raised internally to address this.

In the meantime, I can see the benefit in ensuring the form cannot be submitted. Ideally you’d want a validation error to be displayed to prevent submission of the form. Unfortunately this isn’t implemented as a Core feature, so i’d recommend raising this as an Idea.

However, it is possible to get around this problem using a Code Studio fragment validator. You could create a validator that checks the extension of the file, then returns true to allow submission, or false with the relevant error message.

Unfortunately, there is a bug outstanding at the moment for when you try to get the value of a file using Code Studio, so I can’t provide you any code just yet. Once this bug is resolved, i’ll potentially be able to provide you the exact code so that you can restrict the submission on a form based on file extensions.

Hope this helps :slight_smile: