Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9k views
in .NET FTP by (400 points)
Hello,

I'm downloading a large (30MB) file via a proxy. The proxy does not send any data to my client until it has received all of the file from the remote server. When I download the file the first time the ftp client often gives the following error:

2007-07-13 14:43:49,435 [3580] EnterpriseDT.Net.Ftp.FTPException: The FTP client has not yet connected to the server.  The requested action cannot be performed until after a connection has been established.
   at EnterpriseDT.Net.Ftp.FTPClient.CheckConnection(Boolean shouldBeConnected)
   at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransferOnError()
   at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)


The corresponding log from the edtFTPNet log file is:

DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.384 : ---> TYPE I
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : 200 Type set to IMAGE.
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : ---> PASV
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : 227 Entering Passive Mode (10,81,39,2,134,153)
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : Server supplied address=10.81.39.2
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : Server supplied port=34457
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : NewPassiveDataSocket(10.81.39.2,34457)
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:45.463 : ---> RETR /V2.5/IVYDB.20070705D.zip
DEBUG [FTPControlSocket] 13 Jul 2007 14:28:46.744 : 150 Opening BINARY data connection for \V2.5\IVYDB.20070705D.zip (30088422 bytes)
DEBUG [FTPClient] 13 Jul 2007 14:43:49.435 : Transferred 30088422 bytes from remote host


The file itself downloads fine - despite the error. If I then download the file again (when it is then cached by our proxy, so downloads in a much shorter time) I get no error. I have set the Timeout property on the FTPClient, but wonder if I need to set it somewhere else as well?

Thanks in advance for any help.

14 Answers

0 votes
by (162k points)
Can you post the debug from ftp.exe for a new file?

ftp> debug

will enable debug logging of commands.

After the transfer is it still connected to the server?
0 votes
by (400 points)
Sorry, it would appear that ftp.exe doesn't work:
ftp> debug
Debugging On .
ftp> bin
---> TYPE I
200 Type set to IMAGE.
ftp> get ivydb.20070718D.zip C:\0718.zip
---> PORT 30,254,214,172,9,252
200 PORT command successful.
---> RETR ivydb.20070718D.zip
150 Opening BINARY data connection for ivydb.20070718D.zip (30141624 bytes)
Connection closed by remote host.


I had thought I had it working via this but apparently not.

Does this mean I have two options:

1. Have a separate thread sending no ops to keep the control connection open
or
2. Not use the error status check at the end for large transfers
?

thanks
0 votes
by (162k points)
The proxy is closing the connection.

There's not much you can do about this. If I was coding your application I would catch the exception and retry the download - not ideal but it should work fine. If it fails the second time, let the exception propagate.

Connection closed by remote host.
[/quote]
0 votes
by (400 points)
OK, thanks very much for your help.

Categories

...