Upload Multiple Files using INET?
Hello,
I’m currently able to upload only one file at a time to my server using the code below but would like a way of uploading multiple files at a time. Can someone please help? Thank you!
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
' Set FTP = New DAO ' Inet
Dim ftp As Inet
lblInfo.Caption = "Connecting and Uploading File . . .Please Wait."
With ftp
MsgBox "Local File: " & LocalFileName
MsgBox "Remote File: " & RemoteFileName
Inet1.Protocol = icFTP
Inet1.RemoteHost = HostName
Inet1.UserName = UserName
Inet1.Password = Password
Inet1.Execute Inet1.URL, "Put " + LocalFileName + " " + RemoteFileName
Do While Inet1.StillExecuting
DoEvents
Loop
UploadFile = (Inet1.ResponseCode = 0)
End With
Set ftp = Nothing
LocalFileName = ""
RemoteFileName = ""
Inet1.Execute Inet1.URL, "CLOSE"
Inet1.Cancel
lblInfo.