HI I am writing a java component that gets some files from a FTP server. If the FTP server is behind the firewall and FTP access is blocked in the forewall then the client needs to be intimated that the firewall is stopping files being downloaded. So I think before connnecting to FTP server, if I get the info that accessing FTP server is not possible, then I can flash a message saying FTP server is behind the firewall and is not possible to connect. So how do I go about it? Thanks Mrutyunjay [ March 19, 2002: Message edited by: Mrutyunjay Hanchinal ]
Make visible what, without you, might perhaps never have been seen. - Robert Bresson
Guy Allard
Ranch Hand
Joined: Nov 24, 2000
Posts: 776
posted
0
Hi - Two cases: 1) The wall permits no ftp whatsoever. You should get the infamous 'connection refused' return when attempting to connect. However, you will get the same if the wall allows ftp but the ftp daemon is not started. I know of no way to tell the difference. 2) The wall allows passive ftp but not active (I hope I got those terms right and not backwards). What will happen then, is the initial connect will work OK. But when a 'get' request is issued, the ftp daemon will switch modes and hence TCP/IP port numbers, via a negotiation with the client. It is possible to get 'connection refused' at this point! Again no real way to tell if passive/active is the real problem - maybe the daemon just crashed!
In the second case, I usually assume the wall is not configured correctly. However, it may be that a particular system would be configured to not allow 'get' requests, only 'dir' and such. Depends on the SA's objectives. HTH (and I know it does not much), Good Luck, Guy