Post a reply

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)


Topic review


I finally succeeded.
    "/parcs/download/PNB/", mApplicationDataPath, null,
    options: transferOptions);

Hi Martin,
Just want to make sure this is still on your radar. I still would really appreciate your help on this one. Can you just layout in very straightforward code what I need to do to use GetFilesToDirectory to exclude subfolders? As I mentioned earlier, GetFilesToDirectly asks for a filemask as a parameter but it also include transferoptions. It is not like PutFiles where PutFiles does not include filemask as a parameter. I have tried different combinations and nothing works.
    "/parcs/download/PNB/", mApplicationDataPath,"|*/", false,

Re: help with excluding subfolder in C#

This does not work. GetFilesToDirectory requires another argument for filemask within it that you did not show. If I include it I get an error.
    "/parcs/download/PNB/", mApplicationDataPath, "|*/", false,

I tried just using
transferResult = session.GetFiles(
  "/parcs/download/PNB/", mApplicationDataPath, options: transferOptions);

but this did not work either.

help with excluding subfolder in C#

Sorry to bother you but I'm having a terrible time trying to exclude a subfolder.

my directory structure looks like this. /parcs/download/PNB/Processed
I have an xml file in /parcs/download/PNB that I am moving to a local server. That works fine. However, my code is also finding the /Processed folder and transferring those files as well. How do I make it so that it only gets the files in /parcs/download/PNB and excludes /Processed?
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FileMask = "*/";
TransferOperationResult transferResult;
transferResult =
  session.GetFilesToDirectory("/parcs/download/PNB/", mApplicationDataPath,"*/",false, transferOptions);