tags:

views:

1373

answers:

4

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?

+2  A: 

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.

duckworth
Never really found a good solution to my problem but the free one was a good recommendation.
Austin Salonen
A: 

I sometimes get same error when I list files.

How can I use this ftp client library?

Is it a bad idea try to use Wininet?

Sorry my poor english.

You should ask a new question. It is not nice to hijack questions of other people.
Sam
A: 

For some reason, several people seem to have noticed some success with using only one instance of a NetworkCredential object rather than using a new one for each FtpWebRequest. This worked for me, at least.

adzm
A: 

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.

bmacadam