Exclude Multiple Folders from SFTP transfer

Advertisement

t20
Guest

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 /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)
but when it runs it returns empty directories and does not transfer any of the file in neither the base nor the sub directories

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum