Topic "Move files after upload on local server"

Author Message
medicstuder
[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);
transferResult.Check();
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
session.MoveFile(transfer.FileName, backuppath);
}
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Your duplicate (and answered) post on Stack Overflow:
http://stackoverflow.com/questions/32589819/winscp-move-file-after-upload-with-c-sharp
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License