Android Question FTP error (Host attempting data connection IP1 is not same as server IP2)

abilio486software

Active Member
Licensed User
Hello,

I'm getting this error:

java.io.IOException: Host attempting data connection 67.208.93.232 is not same as server 67.208.93.242

How can I configurethis option on my FTP connection?

"remoteVerificationEnabled=false"

Many thanks
 

drgottjr

Expert
Licensed User
Longtime User
after you initialize, see if this snippet does what you need:
B4X:
    dim jo as javaobject
    Dim r As Reflector
    r.Target = ftp
    jo = r.GetField("client")
    jo.RunMethod("setRemoteVerificationEnabled", Array(False))
then do your file transfer.

as you can see, you need javaobject and reflection. i can't test with your ftp server, but the snippet does not cause a crash when i run it.

setRemoteVerificationEnabled() is a public method in the ftpclient class. that class, is buried in the net library's ftpwrapper. reflection seems to get at it. according to a post by erel, assigning the target of a reflection to a javaobject works. when i tried simply using javaobject, the ftpclient "wasn't found" (sound of crash). when i tried reflection, it seemed to work. see what you get.
 
Upvote 0

abilio486software

Active Member
Licensed User
after you initialize, see if this snippet does what you need:
B4X:
    dim jo as javaobject
    Dim r As Reflector
    r.Target = ftp
    jo = r.GetField("client")
    jo.RunMethod("setRemoteVerificationEnabled", Array(False))
then do your file transfer.

as you can see, you need javaobject and reflection. i can't test with your ftp server, but the snippet does not cause a crash when i run it.

setRemoteVerificationEnabled() is a public method in the ftpclient class. that class, is buried in the net library's ftpwrapper. reflection seems to get at it. according to a post by erel, assigning the target of a reflection to a javaobject works. when i tried simply using javaobject, the ftpclient "wasn't found" (sound of crash). when i tried reflection, it seemed to work. see what you get.

Hello,

It's already working!

Many thanks for your help!! ? Fantastic!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
when i tried simply using javaobject, the ftpclient "wasn't found"
JavaObject can only access public fields and methods. It would have better to make "client" a public member and hide it with @Hide (this library was written before JavaObject was available).
 
Upvote 0
Top