ASP.NET File upload - Validation

Assotsroomy

New Member
In our application , we are using asp.net FileUpload control to upload files.Requirement is , user should be able to upload only ".doc, .xls , .pdf" files. System should not allow him to upload other files. To achieve this we are validating the extension of the uploaded file. If it is not valid then throwing error message.. this works fine..But if i change the any exe file as .doc file , then system is allowing to upload. this should not happen.Is there any way to validate the file with its content instead of its extension ..?
 
Back
Top