hovercraft
Technical User
Sorry to be a pain, but I've looked for some documention on using inet ( msinet.ocx ) and have come up all but empty.
I'm trying to use inet to get a list of all files in a directory on a ftp server.
I'm using the following code to upload to the server and was wondering how the syntax should look to use ls instead of put or get.
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
On Error GoTo ErrHandler
Dim FTP As Inet
Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
ExitHere:
On Error Resume Next
Set FTP = Nothing
Exit Function
ErrHandler:
Debug.Print Err, Err.Description
Resume ExitHere
End Function
Any assistance would be appreciated.
Thanks,
Hovercraft
I'm trying to use inet to get a list of all files in a directory on a ftp server.
I'm using the following code to upload to the server and was wondering how the syntax should look to use ls instead of put or get.
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
On Error GoTo ErrHandler
Dim FTP As Inet
Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
ExitHere:
On Error Resume Next
Set FTP = Nothing
Exit Function
ErrHandler:
Debug.Print Err, Err.Description
Resume ExitHere
End Function
Any assistance would be appreciated.
Thanks,
Hovercraft