bmangold
I have purchased and installed the license but am still receiving errors when attempting to connect via VB. The code I am using is below. It worked fine last week, before the free-trial expired.
Thanks.
Thanks.
'Early Binding "Dual Interface"
'Note: Force the compiler to use the dual interface if available
Set objFTP = CreateObject("sfFTPLib.FTPConnection")
'Early Binding "Mid Level"
'Note: The compiler may use the dual interface
'Set objFTP = New sfFTPLib.FTPConnection
objFTP.Host = "xx.xx.xx.xx"
objFTP.Port = 21
objFTP.Protocol = ftpProtocolNormal 'ftpProtocolSSLExplicit
objFTP.Username = "xxxxx"
objFTP.Password = "xxxxx"
objFTP.Passive = True
objFTP.LogFile = pwd & "ftp.log"
If objFTP.Connect = sfFTPLib.enumError.ftpErrorSuccess Then
MsgBox ("Connected to " & objFTP.Host)
If objFTP.ChangeDirectory("/xxxxx") = sfFTPLib.enumError.ftpErrorSuccess Then
MsgBox ("ChangeDirectory() successful. (" & objFTP.WorkingDirectory & ")")
' Upload File
Dim nRestart
nRestart = 0
Dim strMsg
If objFTP.UploadFile32(pwd & "xxxxx.xml", "xxxxx.xml", nRestart) = sfFTPLib.enumError.ftpErrorSuccess Then
strMsg = "UploadFile32() successful." & vbCrLf
strMsg = strMsg & "LastTransferBytes = " & objFTP.LastTransferBytes32 & " B" & vbCrLf
strMsg = strMsg & "LastTransferTime = " & objFTP.LastTransferTime & " s" & vbCrLf
strMsg = strMsg & "LastTransferSpeed = " & objFTP.LastTransferSpeed & " B/s"
MsgBox (strMsg)
Else
strMsg = "UploadFile32() failed. LastError = " & objFTP.LastError & vbCrLf
strMsg = strMsg & "LastReplyCode = " & objFTP.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & objFTP.LastReply & vbCrLf
MsgBox (strMsg)
End If
' Read Directory
If objFTP.ReadDirectory() = sfFTPLib.enumError.ftpErrorSuccess Then
Dim objDirectory As sfFTPLib.FTPDirectory
Set objDirectory = objFTP.Directory
Dim objItem As sfFTPLib.FTPItem
Dim strList
For Each objItem In objDirectory
strList = strList & "Type=" & objItem.Type & "; Name=" & objItem.Name & "; Size=" & objItem.Size32 & "; Date=" & Format(objItem.Date, "MM/DD/YYYY HH:NN:SS") & vbCrLf
Next
MsgBox (strList)
Else
MsgBox ("ReadDirectory() failed. LastError = " & objFTP.LastError)
End If
Else
MsgBox ("ChangeDirectory() failed. LastError = " & objFTP.LastError)
End If
Else
MsgBox ("Connect() failed. LastError = " & objFTP.LastError)
End If