Checking for file extensions method
A sample method for checking image file extension which can be used for exaple to check upload file control uploaded file types:
Public Shared FileExt As New ArrayListPublic Shared Sub InitImageExt()
FileExt.Add(
".jpeg")FileExt.Add(".jpg")FileExt.Add(
".gif")FileExt.Add(".png")FileExt.Add(
".bmp") End SubPublic Shared Function FileExtensions(ByVal Extension As String) As BooleanReturn FileExt.Contains(Extension.ToLower) End Function
The function returns true or false affter we pass the file extension as argument, before that we must initialize the allowed extensions InitImageExt()
Hope it helps