Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter FileUpload Control?

How to add filter to the fileupload control in asp.net? I want a filter for Oasis File (.000).?

Please advice me... thank you very much!

like image 889
ghie Avatar asked Dec 22 '22 13:12

ghie


1 Answers

You can use RegularExpressionValidator

<asp:RegularExpressionValidator ID="rexp" runat="server" ControlToValidate="fupProduct"
     ErrorMessage="Only .gif, .jpg, .png, .tiff and .jpeg" 
     ValidationExpression="(.*\.([Gg][Ii][Ff])|.*\.([Jj][Pp][Gg])|.*\.([Bb][Mm][Pp])|.*\.([pP][nN][gG])|.*\.([tT][iI][iI][fF])$)"></asp:RegularExpressionValidator>
like image 80
Muhammad Akhtar Avatar answered Jan 02 '23 08:01

Muhammad Akhtar