Exclude Multiple Folders from SFTP transfer
I have a session whose root directory contains multiple folder and file. I want to exclude two directories from transferring from the server directory.
Let's say
I am using the WinSCP NuGet package in VB.NET framework. Currently the code is as follows
but when it runs it returns empty directories and does not transfer any of the file in neither the base nor the sub directories
Let's say
/server/path/one
and /server/path/two
.
I am using the WinSCP NuGet package in VB.NET framework. Currently the code is as follows
Dim transferOptions As New TransferOptions transferOptions.TransferMode = TransferMode.Binary transferOptions.FileMask = $"/server/path/one/;/server/path/two/ | */" transferOptions.AddRawSettings("NewerOnly", "1") Dim transferResult As TransferOperationResult transferResult = session.GetFiles($"{ServerDirectory}", $"{ClientDirectory}", False, transferOptions)