Org.apache.commons.net.ftp use a different port

I want to connect to the FTP server through my servlet, and I know that it works, but to use it on my virtual server I need to change the port that the servlet is connected to, because the FTP server does not use the standard port.

My problem is that I do not know how I can tell FTPClient not to use port 21. For example, it should use port "55555".

FTPClient only wants one parameter, ip, to connect.

using org.apache.commons.net.ftp FTPClient ftp = new FTPClient(); ftp.connect("dyndns"); 

best snown

+7
java apache servlets ftp ftp-client
source share
1 answer

you must use the connect method (host, port)

+13
source share

All Articles