lsalas
06-17-2008, 09:04 PM
Using the setPortAddress(String address) method found in Ftp and Ftps classes you can set the external NAT IP address that will be used by client when issuing PORT command to server for non-passive (active) transfers. Using the setDataPortRange method you may also specify what incoming ports IP address will accept transfers on.
Example
ftp.setPassive(false);
ftp.setPortAddress("212.11.21.1");
ftp.setPortRange(2000,3000);
ftp.connect();
Example
ftp.setPassive(false);
ftp.setPortAddress("212.11.21.1");
ftp.setPortRange(2000,3000);
ftp.connect();