FTP Issue

junaidahmed

Well-Known Member
Licensed User
Longtime User
As I am going to download file from Remote Server via FTP (net) library.I have installed ftp,it works fine when i try to connect filezilla or director from browser.when i try to access by code it shows an error message as java.net.unknownhostexception:unable to resolve host "ftp://202.89.74.155":No associated with hostname.pls see the below code and advise where it is problem.

FTP.Initialize("FTP", "ftp://202.89.74.155",21,"","")
FTP.DownloadFile("/kharind/Dairy/Reports.doc", False, File.DirRootExternal & "/Data/", "Reports.doc")

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 If
End Sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then
Log(LastException.Message)
Msgbox(LastException.Message,"error")
End If
End Sub
 

Asmoro

Active Member
Licensed User
Longtime User
Hi,

B4X:
FTP.Initialize("FTP", "ftp://202.89.74.155",21,"","")

Try without
B4X:
ftp://
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
that also I tried,but still not working.see the attachement and advise
 

Attachments

  • ftp.jpg
    30.3 KB · Views: 217
Upvote 0

Vinians2006

Active Member
Licensed User
Longtime User
I was having the same problem and fixed it setting the "passive" propertie to "false" after initializing.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…