Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private mFTP As FTP
Private mHost, mUser, mPW As String
Private mPort As Int = 21
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
mHost = "ftp.QUI_TUO_NOME_UTENTE.altervista.org"
mUser = "QUI_TUO_NOME_UTENTE"
mPW = "QUI_TUA_PW"
mFTP.Initialize("FTP", mHost, mPort, mUser, mPW)
mFTP.PassiveMode = True
End Sub
Private Sub btnDownload_Click
Dim ServerFilePath, DestDir, DestFileName As String
ServerFilePath = "MODIFICA QUESTO"
FileName = "MODIFICA QUESTO"
DestDir = File.DirApp ' SE VUOI, MODIFICA QUESTO
mFTP.DownloadFile(ServerFilePath, True, DestDir, FileName)
End Sub
Private Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log("Download " & IIf(Success, "completed.", "failed."))
End Sub