469,593 Members | 1,987 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

FtpWebRequest Problem

Hello All:
I've seen some strange behavior with the .net FtpWebRequest component.
static void Main(string[] args)
{
Console.WriteLine("Connecting to server to list
directory...");
Uri uri = new Uri("ftp://192.168.0.3/data/");
FtpWebRequest listRequest =
(FtpWebRequest)WebRequest.Create(uri);
listRequest.Credentials = new NetworkCredential("user",
"pwd");
listRequest.Method = WebRequestMethods.Ftp.ListDirectory;
listRequest.KeepAlive = true;
listRequest.UseBinary = true;
listRequest.UsePassive = true;
FtpWebResponse listResponse =
(FtpWebResponse)listRequest.GetResponse();
//Console.WriteLine(listResponse.BannerMessage.ToStr ing());

StreamReader reader = new
StreamReader(listResponse.GetResponseStream());
string st = reader.ReadToEnd();
Console.WriteLine("List Response:");
Console.WriteLine(st);
Console.ReadLine();
}

This code will produce a WebException 550 File unavailable. The
Response object StatusDescription contains the value "550 Arguements
too long". The folder contains about 800 files. If I change the Uri
to:
Uri uri = new Uri("ftp://192.168.0.3/data/000*.dat");
the program works - it brings back a directory listing matching the
uri. Does anyone know if there is a problem or limitation with the
..Net FTP components?
-Bob

Oct 9 '06 #1
0 1180

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kevin Spencer | last post: by
7 posts views Thread by jose.lopes.cruz | last post: by
2 posts views Thread by Ian Hannah | last post: by
2 posts views Thread by Ian Hannah | last post: by
reply views Thread by Buddy Home | last post: by
9 posts views Thread by Waldy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.