I want to provent few extensions to load in FilUpload control. I have review few references
https://forums.asp.net/t/1051895.aspx?Fileupload+allow+only+jpg+gif+and+png
ASP.NET - Limit file upload available file types
But all are related to "which extensions should be allowed". But I need "which extensions should not allowed".
Can anybody please suggest me regular expression or any other way? I don't want to check manually while submiting.
I have read this example which regular expression about which files to allow. But I need ValidationExpression which doesn't allow some extension. I have list of extension which should not allowed. Can anybody suggest me ValidationExpression
of it?
<asp:RegularExpressionValidator ID="uplValidator" runat="server" ControlToValidate="FileUpload1"
ErrorMessage=".mp3, .mp4 & wma formats are allowed"
ValidationExpression="(.+\.([Mm][Pp][3])|.+\.([Mm][Pp][4])|.+\.([Ww][Mm][Aa]))"></asp:RegularExpressionValidator>