[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    [net] Question about how do I transfer to FTP Server with FTPS Active Mode.
From:       高嶋弘樹 <hiroki.takashima.0823 () gmail ! com>
Date:       2021-10-18 6:40:42
Message-ID: CAJ7P4AJrDNHCFFEKsRcnj0YZ2eu9+O1=9N_VqiRB7QQDMU6EcQ () mail ! gmail ! com
[Download RAW message or body]


Dear developer,

I have a question about how to use the Apache FTP Client library.
I'm an Android app developer.
My application has a feature of FTP transfer using Apache Commons net
library.
I want to transfer using FTPS Active Mode, but it's not working.

How do I transfer to FTP Server with FTPS Active Mode ?

My application logic is below.
1. Create an FTP Client instance. ( Using FTPSClient when in FTPS Mode. )
2. Connect to the FTP server.
3. Execute command. "PBSZ 0" and "PROT P".
4: Login to the FTP server.
5. Set data connection mode to Local Active Mode.
6. Get files list of the FTP server.
    -> Failed to get files list.

I debugged it, and the result is below.
The Socket factory of FTPSClient was set at FTPSSocketFactory when called
"PROT P".
FTPSSocketFactory set "UseClientMode( true )" to socket when creating
server socket.
Then FTPSClient calls "accept" to the server socket.
But it failed with "java.lang.IllegalStateException: Client mode".


I look forward to hearing from you soon.
Thank you.

Best regards,
Hiroki


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic