I have created a list of files on the server.
I them iterate through the list to download them.
The files are created, but they are empty.
Not sure what I am doing wrong, but have a feeling it has something to do with having to wait for each file to download, before downloading the next.
I them iterate through the list to download them.
The files are created, but they are empty.
Not sure what I am doing wrong, but have a feeling it has something to do with having to wait for each file to download, before downloading the next.
B4X:
Sub DownloadListOfBuildings
ProgressDialogShow2("Downloading Building Names" ,False)
FTP.Initialize("FTP", FtpServer, 21, FtpUsername, FtpPassword)
Dim ServerPath As String: ServerPath ="/"
FTP.List(ServerPath)
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Dim FileName As String
For i = 0 To Files.Length -1
FileName = Files(i).Name
Select Case FileName
Case ".","..",".ftpquota"
Case Else:
FTP.DownloadFile("/",True, File.DirInternal, FileName)
End Select
Next
ProgressDialogHide
End Sub