Hi everyone,
I have a small project that connect to an ftp server, at the beginning worked perfect. Now i receive following error :
java.io.IOException: Host attempting data connection 62.231.125.150 is not same as server 62.231.125.2
at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:755)
at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:557)
at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1716)
at anywheresoftware.b4a.net.FTPWrapper$2.run(FTPWrapper.java:239)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)
Here is my code :
Dim ftp As FTP
ftp.Initialize("FTP","server",21,"xxxxxxxx","xxxxxxxx")
ftp.PassiveMode = True
Dim upl As Object=ftp.UploadFile("C:\Users\User\Downloads\","file.doc",False,"/serverpath/file.doc")
Wait For(upl) ftp_UploadCompleted(serverPath As String, Success As Boolean)
If Success Then
ftp.Close
Else
ftp.Close
Return
End If
What is wrong in my code ? how can i solve ?
Thank you