Click here to Skip to main content
16,021,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I'm using a file upload control in my project. I just want the user to select .doc files. Is there any methods to filter the selection of other types of files

Thanks

Nidhin
Posted
Updated 13-Jan-10 0:11am
v2

1 solution

Use a RegularExpressionValidator validator and set the
ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))<br />
    +(.doc|.DOC)$"

and ControlToValidate as the asp:FileUpload control you need to validate

Cibin Jose
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900