Android Question [Solved] B4A FTP Server and Delphi FTP Client

asales

Expert
Licensed User
Longtime User
I have an FTP Client made in Delphi and works fine with B4A FTP Server app of this link:
https://www.b4x.com/android/forum/t...plemented-with-socket-and-asyncstreams.74320/

It uses the command LIST, but it retrive all information of file, like properties and date (see image).

ftp_delphi-2.jpg

B4X:
Case "LIST"
    SetCurrentTask(currentPath, "LIST")

It's possible to change any code in B4A FTP Server to provide only the file name or I need to treat this in Delphi?
 

asales

Expert
Licensed User
Longtime User
Thanks. Problem solved!

B4X:
Private Sub HandleLIST
    Dim sb As StringBuilder
    sb.Initialize
    Dim dir As String = File.Combine(mServer.BaseDir, mTask.Path)
    'create the LIST format
    For Each f As String In File.ListFiles(dir)
        sb.Append(f).Append(mServer.EOL)
    Next
   
    AStream.Write(sb.ToString.GetBytes("UTF8"))
    AStream.SendAllAndClose
End Sub
 
Upvote 0
Top