validation in wmp files
i have windows media player in my application.i want to allow only the supported files for the player, to upload.i want to play photos,videos and audio files with windows media player.how can i do this?how can i validate the uploading files开发者_如何转开发? please help me
use Regular Expression
<asp:RegularExpressionValidator ID="rexpImageE" Display="Dynamic" runat="server"
ControlToValidate="fupImageE" ErrorMessage="Only .gif, .jpg, .jpeg, .png, .tiff, .mp3, .dat"
ValidationExpression="(.*\.([Gg][Ii][Ff])|.*\.([Jj][Pp][Gg])|.*\.([Bb][Mm][Pp])|.*\.([pP][nN][gG])|.*\.([tT][iI][iI][fF])|.*\.([mM][pP][3])|.*\.([dD][aA][tT])$)"></asp:RegularExpressionValidator>
and you can add more extensions to add something like before $ sign |.*.([dD][aA][tT])
精彩评论