jakarta/commons.net



I'm having a devil of a time getting the jakarta ftp lib to work
correctly.

The problem seems to be that the server I want to download to is behind a
firewall. I'm setting the mode to PASV via the command ftp.enterLocalMode
() but it's not working. Here's a snippet and the resulting output.
Anyone know of any problems that are specific to Jakarta?

< begin snippet >
// setup the ftp connection
FTPClient ftp = new FTPClient ();
ftp.connect (src);
ftp.login ("xxxx","xxxx");

ftp.setRemoteVerificationEnabled(false);
System.out.println("..remote verify off");
System.out.println ("FTP: Connected to " + src +".");
System.out.print (ftp.getReplyString ());
ftp.enterLocalPassiveMode();
System.out.print (ftp.getReplyString ());
System.out.println (ftp.getStatus ());
System.out.println(ftp.getPassiveHost());
System.out.println(ftp.getPassivePort());

InputStreamReader isr = null;
try {
isr = new InputStreamReader (ftp.retrieveFileStream
("xxxx.csv"));
boolean success = ftp.completePendingCommand();
} catch (FTPConnectionClosedException e){
System.out.print (ftp.getReplyString ());
e.printStackTrace();
} catch (IOException e) {
System.out.print (ftp.getReplyString ());
e.printStackTrace();
} catch (Exception e) {
System.out.print (ftp.getReplyString ());
e.printStackTrace();
}

< end snippet>

< begin output >
Beginning timestamp Tue Sep 05 01:23:30 EDT 2006
...remote verify off
FTP: Connected to XXX.XXX.com.
200 Switching to ASCII mode.
200 Switching to ASCII mode.
211-FTP server status:
Connected to XXX.XXX.XXX.X
Logged in as ftpsecure
TYPE: ASCII
No session bandwidth limit
Session timeout in seconds is 300
Control connection is plain text
Data connections will be plain text
At session startup, client count was 1
vsFTPd 2.0.1 - secure, fast, stable
211 End of status

null <<< notice that it's not returning the passive host address
-1 <<< or the port!


It ultimately times out.

Any ideas?


.



Relevant Pages

  • [Full-disclosure] PlatinumFTP 1.0.18 remote DoS
    ... PlatinumFTPserver simplifies management of all your Ftp clients with ... PlatinumFTP 1.0.18 server. ... remote server has closed connection ... Second Bug: ...
    (Full-Disclosure)
  • PlatinumFTP 1.0.18 remote DoS
    ... PlatinumFTPserver simplifies management of all your Ftp clients with ... PlatinumFTP 1.0.18 server. ... remote server has closed connection ... Second Bug: ...
    (Bugtraq)
  • Re: Windows 2003 SP2 and FTP
    ... with the windows firewall for our exchange servers. ... connect to the exchange server, we must disable the protect all connections ... Do you have anonymous access to your ftp enabled? ... "Connection closed by remote host". ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: Telnet/ftp problems SBS2000
    ... | through the server to get internet access everything works. ... | client uses an internet backup company to backup his really vital data, ... I understand that you cannot use ftp service to ... the connection can be established ...
    (microsoft.public.windows.server.sbs)
  • Re: Not able to Ftp
    ... I was also looking at the missing challenge from the local security. ... Subject: Not able to Ftp ... 220 Connection will close if idle for more than 5 minutes. ... Search the archives at http://bama.ua.edu/archives/ibm-main.html ...
    (bit.listserv.ibm-main)