Restrict names of files users can upload?

Is there a way to restrict the filenames that users can upload using the file manager? I know this is possible for file extensions (eg limiting only to .pdf) but can it be extended to whole file names? For example, I do not want my users to be able to upload files that have spaces in their names. So “My file.txt” should be rejected but “MyFile.txt” would be fine. Is this possible?
1 answers

Hi Hartley,



Once you upload a document with the filemanager the Filedocument object will be committed.

So you can create a Before Commit event handler on your entity that will check if the file name should be rejected or not.

You can also replace the spaces in the file name with this event handler instead of rejecting it.