Sub Process_Globals
Dim FtpCli As FTP
End Sub
Public Sub Inizializza
FtpCli.Initialize("FtpCliEvent", Main.ftp_server_ip,Main.ftp_server_port,Main.ftp_user,Main.ftp_password)
FtpCli.PassiveMode = True
FtpCli.UseSSL = False
FtpCli.UseSSLExplicit = False
End Sub
Sub FtpUploadFile(dir_file_da_inviare As String, file_da_inviare As String)
Dim sf As Object = FtpCli.UploadFile(dir_file_da_inviare, file_da_inviare, True, "/" & file_da_inviare)
Wait For (sf) FtpCliEvent_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("File was uploaded successfully -> " & file_da_inviare)
Else
Log("Error uploading file - " & LastException.Message)
End If
End Sub
Sub FtpCliEvent_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Dim s As String= "UP " & ServerPath & " " & Round(TotalUploaded / 1000) & "KB "
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub FtpCliEvent_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
End Sub