Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


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.
var sFtppath = "./Solutions/Inbound/";
var sNetpath = @"\\Solutions\Inbound\";
using (_oSession)
    TransferOptions transferOptions = new TransferOptions
        FileMask = "*.txt",
        TransferMode = TransferMode.Automatic
        TransferOperationResult operationResult =
               sNetpath + "*",
        foreach(TransferEventArgs transfer in operationResult.Transfers)
            var tmp = transfer.FileName;
            _oSession.MoveFile(tmp, tmp + ".processed");

The result I get looks like: /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\"