i’m getting error in java ftp code.
SimpleFTP could not request passive mode.
i copied this code from net. but it’s not working
sendLine("PASV");
String response = readLine();
System.out.println(response);
System.out.println(response);
if (!response.startsWith("227")) {
throw new IOException("SimpleFTP could not request passive mode: " + response);
}
It looks like you’re able to connect to the ftp server – otherwise you had received IOExceptions or NullPointerExceptions much earlier.
Problem is, that you can’t establish a passive mode connection. If the server is a standard product, then I assume, it would respond correctly with a
227message.If I had to debug, I’d start with the following: