java - Upload file FTP server -
i stuck during connecting ftp server through apache ftp client. found lots of program out there not able connect ftp server through below code.
ftpclient ftpclient = new ftpclient(); ftpclient.connect("169.144.76.33"); ftpclient.login("root", "re123set"); exception: java.net.connectexception: connection refused @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.abstractplainsocketimpl.doconnect(abstractplainsocketimpl.java:327) @ java.net.abstractplainsocketimpl.connecttoaddress(abstractplainsocketimpl.java:193) @ java.net.abstractplainsocketimpl.connect(abstractplainsocketimpl.java:180) @ java.net.sockssocketimpl.connect(sockssocketimpl.java:384) @ java.net.socket.connect(socket.java:546) @ org.apache.commons.net.socketclient.connect(socketclient.java:176) @ org.apache.commons.net.socketclient.connect(socketclient.java:268)
but whenever trying connect through file zilla ip,user name, password, port(without port can't connect). getting able connect ftp server.
so please me resolve issue..
from fact need enter port in filezilla (which defaults ftp port 21
), assume, not providing information ftpclient
:
1) port number (assuming it's different default 21
). connect non-default port, use connect
overload 2 arguments:
public void connect(string hostname, int port)
2) may using implicit ssl/tls encryption, filezilla (but not ftpclient
) assume port number 990
3) want use sftp (based on sftp
tag question). ftpclient
not support sftp protocol, it's totally distinct ftp. see how retrieve file server via sftp?
Comments
Post a Comment