I wanted a solution that didn't require custom PeopleCode and didn't have to!
The File Extension List allows to specify allowed file extensions and attach this list
to the URL with a FILE_EXT_LIST property.
For this example I will be attaching a file to an expense report using the Financials/Supply Chain PUM Image 35.
In the first step we will create the File extension list:
Navigate to PeopleTools, Utilities, Administration, Administer File Processing, File Extension List
Here you can set up list of file types, by file extensions which either can accept or reject when you do file attachments to your system. In our example below we have allowed .DOC, .DOCX .PNG and .PDF extensions. The option of Absolute tells the system which extensions are explicitly enumerated and have a status of accept.
In the second step we will add the TEST_FILE_EXTENSION_LIST to the URL properties on the Voucher attachment URL. We will use the FILE_EXT_LIST Property.
We can test this by adding an invalid file to an expense report and see the error.
Hope you found this useful!