Hi,
using version asp.net 4.5
I am trying to validate file upload image validation and seems this expression is not working. The file name can be alphanumeric.
extention can be .jpeg|.JPEG|.gif|.GIF|.png|.PNG|.JPG|.jpg|.bitmap|.BITMAP
tried below two expresssion and both are not working.
ValidationExpression="=/^(([a-zA-Z0-9]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpeg|.JPEG|.gif|.GIF|.png|.PNG|.JPG|.jpg|.bitmap|.BITMAP)$/"
ValidationExpression="([a-zA-Z\\].*(.jpg|.png|.bmp|.jpeg|.gif|.tif)$)"
Code:
<asp:RegularExpressionValidator ID="regexUpload" runat="server" ErrorMessage="Upload Images only."
ValidationExpression="([a-zA-Z\\].*(.jpg|.png|.bmp|.jpeg|.gif|.tif)$)"
ValidationGroup="Submit"
ControlToValidate="fileUpload1" ForeColor="Red"> </asp:RegularExpressionValidator>
sample file for i checkd :
12345.jpg
asd123.jpg
asdfg/jpg
anyhelp please