---
title: "How to check uploaded file type using ASP.NET"  
description: "How to check uploaded file type using ASP.NET"  
author: "John Smith"  
published: 2011-01-01  
updated: 2026-05-15  
canonical: https://www.mindstick.com/forum/137/how-to-check-uploaded-file-type-using-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# How to check uploaded file type using ASP.NET

Hello Everyone...\
I have [web application](https://www.mindstick.com/articles/13069/progressive-web-application-pwas-all-you-need-to-know-about) where [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) can [upload](https://www.mindstick.com/forum/12860/how-to-upload-file-asynchronously-using-generic-handler) only .doc [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) on the server...\
Please provide me sample [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) which can [put](https://answers.mindstick.com/qa/111890/can-you-explain-the-difference-between-put-and-post-http-methods) [validation](https://www.mindstick.com/articles/12234/validation-using-data-annotation-using-entity-framework) to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) filetype ..\
\
Thx \

## Replies

### Reply by Anonymous User

Hi,\
\
You can do it by using ReguralExpressionValidator control.\
Check this link for your solution: http://www.mindstick.com/Articles/7d72a758-52bc-4242-922f-6b3914895d92/?Validating%20FileUpload%20control%20for%20specific%20file%20type%20and%20required%20field.\


---

Original Source: https://www.mindstick.com/forum/137/how-to-check-uploaded-file-type-using-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
