Android Question FTP UPLOAD PROBLEM

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hi everyone,

Could anybody tell me what is wrong in my code ? folder list is empty
[CODE lang="b4x" highlight="9-10"]Private Sub lbl_upload_Click
Dim folderExists As Boolean=False
Dim ftp As FTP
VacuumToaFile
If File.Exists(xui.DefaultFolder,"backup.db")=False Then Return
ftp.Initialize("FTP","ftp.xxxxxxxx.xx",21,"xxxxxxxxxxxxx","xxxxxxxxxxxxxxx")
Dim ftp_list As Object= ftp.List("/")
Wait For (ftp_list) ftp_ListCompleted(ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log("Success:"&Success)
Log(ServerPath)
Log(Folders.Length)
If Success Then
For Each f As FTPEntry In Folders
Log(f)
If f.Name=cui Then
folderExists=True
End If
Next
End If
.....[/CODE]

here is the log
Success:true
Server Path: /
Folder lenght:0
ftp folder list in attached imege
1734976373908.png

Thank you
 
Try adding
B4X:
FTP.PassiveMode = True
after FTP.Initialize
 
Upvote 3
Solution
In retrospect, the default mode should have been passive mode. I don't remember any case where active mode worked better.

 
Upvote 0
In retrospect, the default mode should have been passive mode. I don't remember any case where active mode worked better.

🙏
 
Upvote 0
Back
Top