Dear All,
I am doing an application in visual studio 2012 and sql server as beckend. In one page I have to upload a file through file upload control in asp.net. The valid file types are .txt,.doc,.jpg,.pdf. The application should not take any executable file (.exe). Normally by extension checking we can block .exe file upload. But there is another possibilities by which anyone can upload .exe file by renaming the file with valid extension. We have to block those files which are by type is executable file. How can I do that? Please help me out from here. It is too urgent.
Thanks in advance.

Samunder GahlotPosted Jul 26, 2014, 7:29 AM
Validate exe or msi on client and server before saving it on server[^]
But if someone change extension of file before uploading it to server. Than you will have to do some extra code to check this. Below Link will work for you.
Prevent exe or msi to save on server even after changing of extension before uploading exe file[^]
I hope this will help you
Sanjeeb LenkaPosted Jul 18, 2013, 12:55 PM
http://www.netomatix.com/Products/DocumentManagement/MimeDetector.aspx