asp.net - FileUpload Validator error message always shown .net -
i have problem code:
<asp:fileupload id="fulbrowse" runat="server" /> <asp:button id="btnload" runat="server" text="load" onclick="btnload_click" /> <asp:regularexpressionvalidator id="fulbrowsevalidator" runat="server" errormessage="upload zip or dxf files only" validationexpression="^(([a-za-z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.zip|.zip|.dxf|.dxf)$" controltovalidate="fulbrowse"> </asp:regularexpressionvalidator>
that is, if file uploaded zip or dxf, when function btnload_click
ends, errormessage
shown, .
here result:
**
does know why?
thank you
**upload succesful label set when btnload_click
ends.
i change validator ^.+[\.zip|\.zip|\.dxf|\.dxf]$
since file uploader validate filename (unless you're looking specific filename). can expand on zip/dfx
case matching via \.zip|\.zip|...
or can
disable client side scripting enableclientscript="false"
, add
case insensitive flag (?i:^.+[\.zip|\.dxf]$)
Comments
Post a Comment