0

I am trying to connect to an FTP site using this code access FTP using java

but i got this exception:

org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received.  Server closed connection.

So what is i am doing it wrong? i can access this FTP location with no problem using my browser

Anyone have an idea?

Thank you

skystar7
  • 4,419
  • 11
  • 38
  • 41
  • For anyone who have this problem with commons-net, use ftp4j library instead, and it will solve your problem. – skystar7 Jan 24 '13 at 21:11

1 Answers1

1

Hard to say, try adding a protocol Listner (before the client.connect() to get some more info:

 client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
Mike
  • 3,186
  • 3
  • 26
  • 32