Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
15k views
in .NET FTP by (440 points)
Hi, i have been successfully using this FTP object for some time but have found that i am consistantly getting the following error if the file being sent is over 10MB.

IOException in Put(string,string,bool) : System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I can send the same file using WS_FTP for example with no issues.

Is there a limit on the free version?

Here are some of the configuration settings i have..

ftpClient.RemoteHost = ftpSite;
ftpClient.ConnectMode = EnterpriseDT.Net.Ftp.FTPConnectMode.PASV;
ftpClient.CloseStreamsAfterTransfer = true;
ftpClient.SynchronizePassiveConnections = true;
ftpClient.Connect();
ftpClient.User(ftpUsername);
ftpClient.Password(ftpPassword);
ftpClient.TransferType = EnterpriseDT.Net.Ftp.FTPTransferType.BINARY;
ftpClient.BytesTransferred += new EnterpriseDT.Net.Ftp.BytesTransferredHandler(BytesTransferred);

Cheers
Grant.

18 Answers

0 votes
by (158k points)
There's no limit on the free version. With large file failures the commonest problem is the server timing out the client. Post a small segment of the log file that shows the failure & we'll take a look.
0 votes
by (440 points)
Hi Bruce, here are two logs, one that works followed by the one that fails..

WORKS
=====

DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.332 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.332 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.347 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220---------- Welcome to Pure-FTPd [TLS] ----------
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220-You are user number 1 of 50 allowed.
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220-Local time is now 09:36. Server port: 21.
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220-This is a private system - No anonymous login
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220-IPv6 connections are also welcome on this server.
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : 220 You will be disconnected after 15 minutes of inactivity.
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.363 : ---> USER x
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.378 : 331 User x OK. Password required
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.378 : ---> PASS ********
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.441 : 230-User xnhas group access to: x
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.441 : 230 OK. Current restricted directory is /
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.550 : ---> TYPE I
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.550 : 200 TYPE is now 8-bit binary
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.566 : ---> PASV
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.566 : 227 Entering Passive Mode (117,58,251,10,106,83)
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.566 : Server supplied address=117.58.251.10
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.566 : Server supplied port=27219
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.566 : NewPassiveDataSocket(117.58.251.10,27219)
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.582 : ---> STOR /public_html/x.rar
DEBUG [FTPControlSocket] 9 Dec 2008 01:38:56.613 : 150 Accepted data connection
DEBUG [FTPClient] 9 Dec 2008 01:39:28.707 : Closing source stream
DEBUG [FTPClient] 9 Dec 2008 01:39:28.738 : Transferred 4574636 bytes to remote host
DEBUG [FTPControlSocket] 9 Dec 2008 01:39:28.785 : 226-File successfully transferred
DEBUG [FTPControlSocket] 9 Dec 2008 01:39:28.785 : 226 32.174 seconds (measured here), 138.85 Kbytes per second
DEBUG [FTPControlSocket] 9 Dec 2008 01:39:28.816 : ---> QUIT
DEBUG [FTPControlSocket] 9 Dec 2008 01:39:28.832 : 221-Goodbye. You uploaded 4468 and downloaded 0 kbytes.
DEBUG [FTPControlSocket] 9 Dec 2008 01:39:28.832 : 221 Logout.

FAILS
====

DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.546 : 227 Entering Passive Mode (117,58,251,10,137,225)
DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.562 : Server supplied address=117.58.251.10
DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.562 : Server supplied port=35297
DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.562 : NewPassiveDataSocket(117.58.251.10,35297)
DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.562 : ---> STOR /public_html/x.rar
DEBUG [FTPControlSocket] 9 Dec 2008 01:27:17.577 : 150 Accepted data connection
DEBUG [FTPClient] 9 Dec 2008 01:28:30.781 : Closing source stream
DEBUG [FTPClient] 9 Dec 2008 01:28:30.812 : Transferred 10447980 bytes to remote host
ERROR [FTPClient] 9 Dec 2008 01:30:31.344 : IOException in Put(string,string,bool) : System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
A first chance exception of type 'EnterpriseDT.Net.Ftp.FTPException' occurred in edtFTPnet.dll
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply()
at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransfer()
at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile, Boolean append)
CAUSED BY - System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply()
at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransfer()
at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile, Boolean append)
A first chance exception of type 'EnterpriseDT.Net.Ftp.FTPException' occurred in edtFTPnet.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
The thread 0x1264 has exited with code 0 (0x0).
The thread 0x133c has exited with code 0 (0x0).
The program '[2104] Continuous.vshost.exe: Managed' has exited with code 0 (0x0).

Regards
Grant.
0 votes
by (158k points)
The server has timed out the connection. You need a higher server timeout.
0 votes
by (440 points)
Is this a client setting or do i need to contact my ISP?
0 votes
by (158k points)
Yes you need to ask your ISP to set the server timeout higher. It looks like it disconnects you after 1 minute.
0 votes
by (440 points)
Wouldnt the tranfser fail when using WSFTP though?
0 votes
by (158k points)
It depends how fast it is. If WSFTP is written in C (I think it is, it uses OpenSSL) it is probably quite a bit faster than a .NET application running in a virtual machine.

Take a look at the WSFTP log and see how long the transfer takes. If it is < 1 minute, try a bigger file that takes > 1 minute.
0 votes
by (440 points)
Hi, sorry its taken so long to get back to you but i have just tried uploading a 15MB file using WS. No problems there. Any ideas?
Oh and it took well over a minute as well.
0 votes
by (158k points)
Have you got a log file from WS? Or try Filezilla and see if anything is in the logfile. Sometimes clients can send NOOP messages during the transfer to keep the connection alive.
0 votes
by (440 points)
Hi again.. this is the log file from a 25MB file i just transferred..

STOR file.exe
150 Accepted data connection
226-File successfully transferred
226 175.365 seconds (measured here), 139.14 Kbytes per second
transferred 24986408 bytes in 175.359 seconds, 1113.179 Kbps ( 139.147 Kbps), transfer succeeded.
Transfer request completed with status: Finished
TYPE A
200 TYPE is now ASCII
PASV
227 Entering Passive Mode (117,58,251,10,230,220)
connecting data channel to 117.58.251.10:230,220(59100)
data channel connected to 117.58.251.10:230,220(59100)

Categories

...