Search code examples
javaftpapache-commons-net

Difference between enterLocal...() and enterRemote...() methods in FTPClient class from org.apache.commons.net.ftp


I'm trying to figure out the difference between enterLocalActiveMode()/enterLocalPassiveMode() and enterRemoteActiveMode(InetAddress host, int port)/enterRemotePassiveMode() methods of FTPClient class from org.apache.commons.net.ftp.

I've only found some information about the difference between active and passive mode with FTP. But I don't understand the concept of local and remote previously mentioned.


Solution

  • The Apache Commons Net documentation (which you link yourself in the question) covers this.

    In 99.9% cases, you want to use FTPClient.enterLocal*Mode. That's for client-server transfers.

    The FTPClient.enterRemote*Mode is only for server-server transfers (aka FXP). What most FTP servers do not allow anyway.