Android Question FTP Server without user and password?

Sasuke Sama

Active Member
Licensed User
Hello
Im using the b4x ftp server class and it works great but i wants it to work without asking for user and password when connected from other devices
i see b4a bridge can do that i took a look at it source but was unable to understand how it can do it
Thanx in advance
 

DonManfred

Expert
Licensed User
i see b4a bridge can do that i took a look at it source but was unable to understand how it can do it
B4X:
Public Sub SetFTPServerState
    If Main.FTPServerEnabled Then
        If FTP.IsInitialized And FTP.Running Then Return
        FTP.Initialize(Main, "ftp")
        FTP.AddUser("anonymous", "") ' HERE
        FTP.BaseDir = File.DirRootExternal
        FTP.SetPorts(FTP_PORT, 6782, 6788)
        FTP.Start
    Else
        If FTP.IsInitialized And FTP.Running Then
            FTP.Stop
        End If
    End If
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
FTP.AddUser("anonymous", "") ' HERE
this lines add the anonymous user with no password. This is kind of a standard when no special login is required.
A user who want to connect to the server usually use an ftp client. In the ftp client your usually can say that you want to use anonymous login.
In this case the ftp client is using anonymous as the loginname and send an empty password.
 
Upvote 0

Sasuke Sama

Active Member
Licensed User
this lines add the anonymous user with no password. This is kind of a standard when no special login is required.
A user who want to connect to the server usually use an ftp client. In the ftp client your usually can say that you want to use anonymous login.
In this case the ftp client is using anonymous as the loginname and send an empty password.
I tried it but still not working
this lines add the anonymous user with no password. This is kind of a standard when no special login is required.
A user who want to connect to the server usually use an ftp client. In the ftp client your usually can say that you want to use anonymous login.
In this case the ftp client is using anonymous as the loginname and send an empty password.
B4X:
server.Initialize(Main, "FTPServer")
server.SetPorts(51041, 51042, 51142)
server.AddUser("anonymous", "")
server.BaseDir = File.DirRootExternal
server.Start
Using this code it still asking for user and password :(
 
Upvote 0

DonManfred

Expert
Licensed User
Using this code it still asking for user and password :(
You did not read what i wrote, right?
this lines add the anonymous user with no password. This is kind of a standard when no special login is required.
A user who want to connect to the server usually use an ftp client. In the ftp client your usually can say that you want to use anonymous login.
In this case the ftp client is using anonymous as the loginname and send an empty password.
So. USE anonymous als login and use an empty string as password
 
Upvote 0
Top