restrict the form to submit when attached documents are not in these formats( .pdf, .docx)

Ramesh_143
Giga Guru

I have a catalog item, when the user attaches any document while filling catalog form do not allow the form to submit, if the attached document are in these formats pdf, docx. 

 

Anyone help me how to fetch attached document names, format and to achieve the above thing.  I want to Perform this in Portal Side. If user attaches other than these documents show some error or alert message.