Still struggling with the FTP library... I am just not getting part of it..
I got it to connect, and I can upload or download any specific files (if I specify exact filenames). I need a very simple sub to list files, then download all available files in a given directory (they are small text files, and I do not know the names at any given time - i just need to grab them all).
I have this code from the examples:
I can't figure out how to use the data now... I just want to download all of the files found then delete them off the server directory.
I know I need to execute a download like this:
ftp.download(MyServer, DownloadDIR, true, ?? filenames??)
But how do I identify the file names? files(i).name or something like that?
I got it to connect, and I can upload or download any specific files (if I specify exact filenames). I need a very simple sub to list files, then download all available files in a given directory (they are small text files, and I do not know the names at any given time - i just need to grab them all).
I have this code from the examples:
B4X:
FTP.List("/")
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = False Then
Log(LastException)
Else
For i = 0 To Folders.Length - 1
Log(Folders(i).Name)
Next
For i = 0 To Files.Length - 1
Log(Files(i).Name & ", " & Files(i).Size & ", " & DateTime.Date(Files(i).Timestamp))
Next
End If
End Sub
I can't figure out how to use the data now... I just want to download all of the files found then delete them off the server directory.
I know I need to execute a download like this:
ftp.download(MyServer, DownloadDIR, true, ?? filenames??)
But how do I identify the file names? files(i).name or something like that?