Parent folder on SFTP being automatically created in local folder
How do I stop the parent folder of a file being downloaded from SFTP being created locally? Here is a snippet of my code.
The result I get looks like:
The second
var sFtppath = "./Solutions/Inbound/"; var sNetpath = @"\\Solutions\Inbound\"; ... using (_oSession) { TransferOptions transferOptions = new TransferOptions { FileMask = "*.txt", TransferMode = TransferMode.Automatic }; try { TransferOperationResult operationResult = _oSession.GetFiles( sFtppath, sNetpath + "*", false, transferOptions); operationResult.Check(); foreach(TransferEventArgs transfer in operationResult.Transfers) { var tmp = transfer.FileName; _oSession.MoveFile(tmp, tmp + ".processed"); } ...
/Solutions/Inbound/1579952381-20220902-022723.txt
downloaded to \\Solutions\Inbound\Inbound\1579952381-20220902-022723.txt
The second
Inbound
in the destination is automatically created. How do I stop this? Doesn't make sense to me since my destination variable is explicitly clear, i.e.
sNetpath = @"\\Solutions\Inbound\"