B4J Question Ho to command Filezilla via B4J code ?

amorosik

Expert
Licensed User
Longtime User
I have a B4J program that runs on a PC, where Filezilla Server is currently running
I would need to create a list of users/passwords/homes in Filezilla Server so that it is accessible by multiple users with different home directories
It is also necessary to delete a specific Filezilla Server user, always using B4J code

Do you know if Filezilla Server can be controlled, via script, com interface, or other system?
 

teddybear

Well-Known Member
Licensed User
Which version Filezilla server are you using? what OS is it deployed on? perhaps you can try this api
 
Last edited:
Upvote 0

amorosik

Expert
Licensed User
Longtime User
Which version Filezilla server are you using? what OS is it deployed on? perhaps you can try this api

Filezilla Server 1.9.4
Tryng to convert the c# code:

B4X:
Sub CreateFileZillaUser()
    Dim Job As HttpJob
    Job.Initialize("FileZilla", Me)
   
    Dim adminUser As String = "admin" ' Sostituisci con il tuo username admin
    Dim adminPassword As String = "password" ' Sostituisci con la tua password
   
    Dim url As String = "http://localhost:14148"
   
    ' JSON per creare un nuovo utente
    Dim json As String = $"{
        "command": "User.AddUser",
        "arguments": {
            "name": "NewUser"
        }
    }"$
   
    ' Invia richiesta HTTP
    Job.Username = adminUser
    Job.Password = adminPassword
    Job.PostString(url, json)
    Job.GetRequest.SetContentType("application/json")
End Sub

Sub JobDone(Job As HttpJob)
    If Job.Success Then
        Log("Risposta: " & Job.GetString)
    Else
        Log("Errore: " & Job.ErrorMessage)
    End If
    Job.Release
End Sub

Now i try
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Filezilla Server 1.9.4
Tryng to convert the c# code:

Note! FileZilla server 1.x is NOT supported​

That's why I would like to ask the version.
What OS platform are you are using?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
I know, what platform? linux, windows?
if you would like to manage users, you can do that by modifing the file users.xml

it looks like this
XML:
<user name="test1" enabled="true">
        <mount_point tvfs_path="/abc" access="1" native_path="" new_native_path="d:\abc" recursive="2" flags="0" />
        <rate_limits inbound="unlimited" outbound="unlimited" session_inbound="unlimited" session_outbound="unlimited" />
        <allowed_ips></allowed_ips>
        <disallowed_ips></disallowed_ips>
        <session_open_limits files="unlimited" directories="unlimited" />
        <session_count_limit>unlimited</session_count_limit>
        <description></description>
        <password index="1">
            <hash>f6oC4y9fd50IUJJpkXiiHZLxRbXCUo14ZBXvI5Y/UzM</hash>
            <salt>OLRO7qmiLANOzcR8IeZhq8Bg5qV1xn9GiOJqpC3XGA0</salt>
            <iterations>100000</iterations>
        </password>
        <methods>password</methods>
    </user>
 
Last edited:
Upvote 0
Top