An OOTB "pxUploadFile" activity is called for uploading the file. Internally it invokes another OOTB activity "CallVirusCheck". You can tweak the code of this activity's Java step to check the file extension and restrict hereby.
- "pxAttachName" property contains name the of the file attached. Call a validate rule on this and check for the extension.
Or else, you can use any other custom approach based on your requirement to validate the extension.
- User Page-Set-Message/Property-Set-Message method to configure a validation error which you want to display on the UI.
Hope it helps in your implementation, kindly notify by marking this post as answered/helpful for tracking purpose.
When we use the Drag and drop file or the Select File option, we are using the OOTB controls which call pyUploadFile activity(provided you have not overridden the default activity parameter). This activity is not final and can be used for testing the file type.
In Pega 7.2.2 if you are using the pzMultiFilePath control(default for drag and drop), pyUploadFile is the default activity configured. Please check the control you are using and if you are overriding the default activity.
Sorry I can't help with the exact code here. The approach I had in mind was to go after
If there is a problem you see with this approach, then let us know so that we can help from that point on.