Hello
With the following code
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Dim validFileTypes As String() = {"bmp", "gif", "png", "jpg", "jpeg", "doc", "docx", "txt", "xls"}
Dim ext As String = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName)
Dim isValidFile As Boolean = False
For i As Integer = 0 To validFileTypes.Length - 1
If ext = "." & validFileTypes(i) Then
isValidFile = True
Exit For
End If
Next
If Not isValidFile Then
Label1.Text = "Invalid File. Please upload a File with extension " & _
String.Join(",", validFileTypes)
Try
FileUpl ...
Go to the complete details ...