0 votes

Hello,

I try to download 4 files for a path. I get "Connection closed; transfer aborted" when I try to download one of the files (267KB).

Any suggestions?

My code looks like this

Limilabs.FTP.Log.Enabled = true;

using (Ftp client = new Ftp())
{
   client.Connect(file.Ftp_ip);  
   client.Login(file.Ftp_dw_user, file.Ftp_dw_password);

   byte[] bytes;
   try
   {
       bytes = client.Download(file.File_name);
       streamFichero = new MemoryStream(bytes);
   }
   catch (FtpException ex)
   {
        ....
   }

The other files (smallers) download successfully.

If I tried to download only this file I get the same error.

by
edited by
How does your code look like?
Are you getting an exception?

I assume other 3 files are downloaded without problems.

What happens if you try to download just this one file that is not working?

Here you can see how to turn on logs:
https://www.limilabs.com/blog/logging-in-ftp-dll
Are you getting an exception (what type?, what is the exact message/stacktrace)?
How does the log look like?

1 Answer

0 votes

With that limited information it's really hard to help.

Some points:
- This error is not generated by Ftp.dll, it rather looks like server generated.
- Examine the logs: https://www.limilabs.com/blog/logging-in-ftp-dll
- Consider using SSL connection or disable your firewall/AV software as they may interfere and cut the connection, if they think you are downloading some harmful content.
- Try different location (so your company AV/Firewall can be ruled-out)
- Check if you are able to download this file with UI client like FileZilla.
- 267KB is not a big file, it may be somehow broken on the server.
- Consider using longer timeout values.

by (297k points)
...