Validate file extension before file upload in javascript using asp.net by Regular expressions
this article ,I will explain how to cheak or validate file in file upload control using javascript and regular expression to cheak file extension before file upload using Javascript in ASP.NET.
this article ,I will explain how to cheak or validate file in file upload control using javascript and regular expression to cheak file extension before file upload using Javascript in ASP.NET.
Regular expression to validate file formats for .mp3 or .MP3 or .mpeg or .MPEG or m3u or M3U
Re= /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.mp3|.MP3|.mpeg|.MPEG|.m3u|.M3U)$/;
Regular expression to validate file formats for .doc or .docx
Re= /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.doc|.docx|.DOC|.DOCX)$/;
Regular expression to validate file formats for .txt or .TXT
Re= /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.txt|.TXT)$/;
Regular expression to validate file formats for .jpeg or .JPEG or .gif or .GIF or .png or .PNG
Re= /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpeg|.JPEG|.gif|.GIF| .png|.PNG)$/;
|
No comments:
Post a Comment