FTP Connection Refused

Mahares

Expert
Licensed User
Longtime User
I downloaded FTP FileZilla Server 0.9.41. Had it set up on one of my PCs as a server. The PC is connected to a router via Ethernet. It seems to work. I cannot connect using a Droid device via the below code that is circulating in the forum: The error on the device is: Java.net.connectException Localhost/127.0.0.1:21-connection refused. My Windows XP firewall is turned off. I even temporarily turned my virus protection firewall off. Has anyone encountered such error message and its origin? Thanks
Code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
'        FTP.Initialize("FTP", "ftp.temasis.com.ar", 21, "ftpsarly", "cacota")
                FTP.Initialize("FTP", "127.0.0.1", 21, "namehere", "passwordhere")
    End If
    Activity.LoadLayout("Main")
End Sub


Sub Button1_Click
'    FTP.DownloadFile("Team/prestadores.txt", False, File.DirRootExternal, "PRESTATUTI.txt")
        FTP.DownloadFile("Export/AR1_Base.tab" , False, File.DirRootExternal, "My_Base.tab")

End Sub

Sub FTP_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
    Dim s As String
    s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
    If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
    Log(s)
End Sub

Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
'    Log(ServerPath & ", Success=" & Success)
'    If Success = False Then Log(LastException.Message)
        Msgbox(ServerPath,"")
    If Success = False Then Msgbox(LastException.Message,"")
End Sub
 

NJDude

Expert
Licensed User
Longtime User
You have to change this line:
B4X:
FTP.Initialize("FTP", "127.0.0.1", 21, "namehere", "passwordhere")

You need to put your server's IP, the line above is trying to connect your device to itself.

Also, DELETE the commented line you have above, you are posting your user name and password to your server (ftp.temasis.com.ar)
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
From the command line I did : ipconfig, but the black screen blinks fast and disappears. I even tried ipconfig /p and ipconfig /w. I could not read the IP address. Is there an easier way to get that IP address. The PC has Windows XP home.
Thanks
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thanks NJDude. You are the pride of NJ. After succeeding to download to the device, I am going to work on the upload from the device and let you know if I have any issues.
Thanks again
 
Upvote 0
Top