Directory Transfer: Multiple file mask

Advertisement

Andres
Guest

Directory Transfer: Multiple file mask

Hi guys. Thanks for this awesome library :) its helping a lot.

Im working with VS2015 c# and I have following code.

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = tmde;
transferOptions.FileMask = jsonConfig.files_mask; // that will contain "*.jpg;|*/"; 

 SynchronizationResult syncResult = session.SynchronizeDirectories(SynchronizationMode.Remote,
                                                                jsonConfig.local_path,
                                                                jsonConfig.remote_path,
                                                                false,
                                                                false,
                                                                SynchronizationCriteria.None,
                                                                transferOptions);

But sadly it works only with the last or only one file mask.
Is there any way to add more than one?


Thanks in advance.

Reply with quote

Advertisement

Andres
Guest

Thanks Martin, now I get it.

If anyone is interested, This make the trick to filter by file type and exclude sub folders:
*.jpg |  */

For instance:
transferOptions.FileMask = jsonConfig.files_mask + " | */";
[/code]

Reply with quote

Jovy
Guest

How to transfer multiple file types

Hi,

I've succeeded to transfer one file type but how do I code it in script and batch file? For instance I need to transfer both csv and txt file? How should I append it.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,624
Location:
Prague, Czechia

Re: How to transfer multiple file types

Jovy wrote:

I've succeeded to transfer one file type but how do I code it in script and batch file? For instance I need to transfer both csv and txt file? How should I append it.
It would help, if you show us your current code.
Until you do, I can only point you to the documentation:
https://winscp.net/eng/docs/file_mask#combining

Reply with quote

Advertisement

You can post new topics in this forum