Topic "Move files after upload on local server"

Author Message
[View user's profile]

Joined: 2015-09-15
Posts: 1
Location: Georgia
I am working on a C# console program. So far it is working great. What it does is log into the remote SFTP server and copy files from our server to theirs. What I want it to do after the files are copied is move the local files from the current directory to a "sent" directory.

Here is what I have (it does not throw an errors and when testing the log shows the mv sourcepath to backuppath, but the files still remain in the sourcepath and never appear in the backup path.

transferResult = session.PutFiles(OutboundPath, UploadPath, false, transferOptions);
foreach (TransferEventArgs transfer in transferResult.Transfers)
Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
session.MoveFile(transfer.FileName, backuppath);
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
Your duplicate (and answered) post on Stack Overflow:

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License