Sub SubmitButton_Click(Source As Object, e As EventArgs)
Dim filepath As String = "C:\Uploads"
Dim uploadedFiles As HttpFileCollection = Request.Files
Dim i As Integer = 0
Do Until i = uploadedFiles.Count
Dim userPostedFile As HttpPostedFile = uploadedFiles(i)
Try
If (userPostedFile.ContentLength > 0) Then
Span1.InnerHtml += "<u>File #" & (i+1) & "</u><br>"
Span1.InnerHtml += "File Content Type: " & _
userPostedFile.ContentType & "<br>"
Span1.InnerHtml += "File Size: " & _
userPostedFile.ContentLength & "kb<br>"
Span1.InnerHtml += "File Name: " & _
userPostedFile.FileName & "<br>"
userPostedFile.SaveAs(filepath & "\" & _
Path.GetFileName(userPostedFile.FileName))
Span1.InnerHtml += "Location where saved: " & _
filepath & "\" & _
Path.GetFileName(userPostedFile.FileName) & _
"<p>"
End If
Catch ex As Exception
Span1.InnerHtml += "Error:<br>" & ex.Message
End Try
i += 1
Loop
End Sub