Hi,
I'm having trouble getting the FTP.List to call the FTP_ListCompleted Event. Looking around the forum, I learned that the FTP.List function should call the FTP_ListCompleted event when there's data retrieved. My program uses the FTP.List function but the event is never called.
I've tested the FTP credentials using filezilla (IP, username, password and port) and all seems well.
I must be using FTP in the wrong order perhaps, but it's got to the point where i'm just confused.
Help?
The code below is from a code module called from another activity. The reason for FTP is to allow for an update of the program APK. The global variables are used later in the ListCompleted event, but since this is never called, I deemed it unnecessary to post (keep things as simple as possible).
I'm having trouble getting the FTP.List to call the FTP_ListCompleted Event. Looking around the forum, I learned that the FTP.List function should call the FTP_ListCompleted event when there's data retrieved. My program uses the FTP.List function but the event is never called.
I've tested the FTP credentials using filezilla (IP, username, password and port) and all seems well.
I must be using FTP in the wrong order perhaps, but it's got to the point where i'm just confused.
Help?
The code below is from a code module called from another activity. The reason for FTP is to allow for an update of the program APK. The global variables are used later in the ListCompleted event, but since this is never called, I deemed it unnecessary to post (keep things as simple as possible).
B4X:
Sub Process_Globals
Dim FTP As FTP
Dim Fname As String
Dim FVersion As String
Dim ServerIP As String
Dim URL As String
End Sub
Public Sub CheckForUpdates(URL1 As String,ServerIP1 As String,Fname1 As String,FVersion1 As String)
URL = URL1
ServerIP = ServerIP1
Fname = Fname1
FVersion = FVersion1
FTP.Initialize("FTP",ServerIP,21,"*****","*****")
FTP.List("/") 'ListCompleted Sub Called Automatically
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
If Success = False Then
Log(LastException)
Else
Log("FTP Success")
End If
End Sub