3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by dnanetwork
0

Hi, I am using file upload control in .net. But I want , the user only able to upload doc, docx and pdf file.How do I make it possible?

string strExtension = Path.GetExtension(this.FileUpload1.FileName)

if (strExtension != ".doc" && strExtension != ".docx")

{  // prompt your warning message to client }

else

{  // upload the file if validation pass }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.