On large files (~200+ MB), I get the 503 error when I read the stream.
ftp = (FtpWebRequest)WebRequest.Create(new Uri(address.AbsoluteUri + @"/" + file.Name));
ftp.Credentials = new NetworkCredential(username, password);
ftp.Method = WebRequestMethods.Ftp.DownloadFile;
response = (FtpWebResponse)ftp.GetResponse();
Any clues on what I'm doing wrong or a better practice for larger files?
Do you receive the 503 after every attempt or only subsequent attempts?
Have you tried setting the disabling KeepAlive?
ftp.KeepAlive = false;
I would try a more rubust ftp client library, a basic free one can be at sourceforge.
I'd concur that minimizing the number of NetworkCredential objects solves the problem. I experienced this problem and created a single CredentialCache and added each credential once. No more ftp errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With