Topic "Directory Transfer: Multiple file mask"

Author Message
Andres

Guest


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

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

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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25748
Location: Prague, Czechia
I'm not sure I understand the question.

If you want more masks, just separate them with a semicolon, like *.jpg;*.png;*.gif | */
https://winscp.net/eng/docs/file_mask#combining
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:
Code:
*.jpg |  */


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

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License