0

I am trying to get an FTP directory listing. I have more than 10,000 files in my folder and it seems that the list I get back is truncated at 10,000 files. Is there anything I can do so that I can get all the files back?

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://mysite.com");
request.Method = WebRequestMethods.Ftp.ListDirectory;

request.Credentials = myCache;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
string Datastring = reader.ReadToEnd();

string[] myfiles = Datastring.Split(new string[] { Environment.NewLine },
    StringSplitOptions.RemoveEmptyEntries);
Daniel A.A. Pelsmaeker
  • 47,471
  • 20
  • 111
  • 157
Rob Sedgwick
  • 4,342
  • 6
  • 50
  • 87
  • yeah it's similar the difference I suppose is that he's using software whereas I am writing my own code. It's no use to me if a bit of software can do it because I need to do it from .net code. – Rob Sedgwick Apr 01 '13 at 20:43
  • Point is that it's a common limitation and appears to be a server setting. – Peter Ritchie Apr 01 '13 at 20:47

0 Answers0