Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: How to download certain amount of files?

You definitely have to skip the . and .., and in general any (sub)directories.
Post a session log file, if you want more details.
ferliano001

How to download certain amount of files?

When I try to download using session.GetFiles(path) everything is fine and I get all 500 files, but in my case I need to download 125 files out of 500, so I made this method, because I didn't find any ready to go method for such operation in docs, maybe I am wrong tho.

So when I use this method it loses some of my files, for example I constantly get only 118 out of 125 (I tried to test it like 10 times with the same result) and I can't understand why, would be great if I am just wrong and there is a better way to do what I need using docs.
int currentFile = 0;

RemoteDirectoryInfo directory=testSes.ListDirectory(cfgTorrentsPath);
foreach (RemoteFileInfo fileInfo in directory.Files) {
      session.GetFiles(path + fileInfo.Name, Directory.GetCurrentDirectory() + @"\folder\"+fileInfo.Name);
      if (currentFile >= 125) {
         break;
      }
      currentFile += 1;
}