I am uploading images to a folder using asp FileUpload which works fine. But I need to add associated text with the file. So when downloaded say in a DataList it relates to the image. Ideally, I would like to upload more than a single entry. I have searched the obvious sites but canât resolve the problem. Is it possible?
My upload
VB code below.
Code:
Sub upAdd_Click(ByVal sender As Object, ByVal e As EventArgs)
If (FileUpload1.HasFile) Then
If (CheckFileType(FoleUpload1.FileName)) Then
Dim filePath As String = "~/images/" & FileUpload1.FileName
FileUpload1.SaveAs(MapPath(filePath))
End If
End If
End Sub
Function CheckFileType(ByVal fileName As String) As Boolean
Dim ext As String = Path.GetExtension(fileName)
Select Case ext.ToLower()
Case ".gif"
Return True
Case ".png"
Return True
Case ".jpg"
Return True
Case ".jpeg"
Return True
Case ".pdf"
Return True
Case ".doc"
Return True
Case ".xls"
Return True
Case Else
lblError.Text = "Invalid File Extension"
Return False
End Select
End Function