Android Question FTP issues not loading list

tsteward

Well-Known Member
Licensed User
Longtime User
I am in the middle of changing hosting companies and I am struggling to get FTP to work.
I have set up a user and can access the files with notpad++ via ftp without issues
This code does return success = true
But folder and files are empty.

Image is file structure

I must be doing something wrong. It worked with my previous host just fine.

B4X:
'actual path
'ftp://lara-app%40locksdownunder.com.au@ftp.locksdownunder.com.au/public_html/usersTools/1089/MyTools.txt

Private ftp As FTP
ftp.Initialize("ftp","ftp.locksdownunder.com.au",21, "lara@locksdownunder.com.au", "mypassword")
ftp.PassiveMode = True
ftp.List($"ftp.locksdownunder.com.au/public_html/usersTools/"$ & Main.userID)
Wait For FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) '<----
If Success Then
    Log(Folders)
    Log(Files)
End If
#if b4a
ftp.Close
#End If
 

Attachments

  • Screenshot 2025-04-17 202443.png
    Screenshot 2025-04-17 202443.png
    25.2 KB · Views: 29

Daestrum

Expert
Licensed User
Longtime User
log cant print arrays, you need to loop through the array and print each one separately.
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Okay I changed code but still no folders or files
B4X:
Private ftp As FTP
ftp.Initialize("ftp","ftp.locksdownunder.com.au",21, "lara-app@locksdownunder.com.au", "my password")
ftp.PassiveMode = True
ftp.List($"ftp.locksdownunder.com.au"$) '/public_html/usersTools/"$ & Main.userID)
Wait For FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) '<----
If Success Then
    For Each f As FTPEntry In Files
        Log(f)
    Next
End If
#if b4a
ftp.Close
#End If
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
What do you get printed now? maybe you need to get something like f.getName() or f.getPath() (dont know what commands are in FTPEntry)
 
Upvote 0
Top