Skip to content

Instantly share code, notes, and snippets.

@timothyclifford
Created March 18, 2012 03:22
Show Gist options
  • Save timothyclifford/2068418 to your computer and use it in GitHub Desktop.
Save timothyclifford/2068418 to your computer and use it in GitHub Desktop.
Regular expression file extension filter
<asp:RegularExpressionValidator ID="regexFileUpload" runat="server" ControlToValidate="FileUploadControlID" ErrorMessage="Uploaded file should be .doc, .docx or .pdf files only" ValidationExpression="^.*\.(doc|DOC|docx|DOCX|pdf|PDF)$"></asp:RegularExpressionValidator>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment