Posted on: 5/11/2011 4:23:51 AM | Views : 239

Putting up a quick code like below in a new asp.net page you can test that the fileupload validation does not work correctly only in Internet Explorer and Chrome.
<asp:FileUpload id="fup" runat="server" /> <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" controltovalidate="fup" enableclientscript="true" errormessage="Invalid File" text="invalid file" validationexpression="^[a-za-zA-Z0-9_\.]{3,28}\.(pdf|txt|doc|docx|png|gif|jpeg|jpg|zip|rar)$"></asp:RegularExpressionValidator>
the regular expression does the below.
File name must be within 28 characters long and should be atleast 3 characters long. Can contains alpha numeric code and ' . ' After the filename there should be a ' . ' and comes file extension validation ...

Go to the complete details ...