In previous post we have seen  simple example for uploading files in ASP.NET. And in this post we will see uploading files of particular type. We have to filter the file type based on its Content Type(MIME type). Here I am discussing about uploading doc/docx files in asp.net. Add a new folder “uploads” to your asp website. Because in this example we are uploading files to the Upload folder in our Asp Application. First take a upload control on Default.aspx, the code is give below.

The C# code in the code behind file is given below :

See the images below:

When a ms word file is uploaded:

upload doc files asp.net

When a file other than ms word file:

Upload doc files Asp.Net

1 thought on “Uploading MS WORD ( DOC / DOCX ) FILES IN ASP.NET”

Comments are closed.