Topic "Error uploading files to Remote Directory"

Author Message
[View user's profile]

Joined: 2014-09-23
Posts: 1
Location: USA
I am trying files to remote directory. The source folder is "Data" (relative to current directory) and the destination is \rcmprod\.

I have attached the log for the session.

here is the code iam using:

// Setup session options
SessionOptions sessionOptions = new SessionOptions
Protocol = Convert.ToBoolean(ConfigurationManager.AppSettings["UseSFTP"]) ? Protocol.Sftp : Protocol.Ftp, //If SFTP is configured then use that or else use FTP ; in PROD it should be SFTP
HostName = ConfigurationManager.AppSettings["SFTPHost"],
UserName = ConfigurationManager.AppSettings["SFTPUserName"],
Password = ConfigurationManager.AppSettings["SFTPPassword"],
SshHostKeyFingerprint = Convert.ToBoolean(ConfigurationManager.AppSettings["UseSFTP"]) ? ConfigurationManager.AppSettings["SFTPHostKey"] : null

using (Session session = new Session())

session.SessionLogPath = GetSessionLogPath();
// Connect

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult;
transferResult = session.PutFiles(ConfigurationManager.AppSettings["SFTPSourceFolder"], ConfigurationManager.AppSettings["SFTPRemoteFolder"], false, transferOptions);
//rcmtest is the remote folder at the root level

// Throw on any error

// Print results and Archive data file
foreach (TransferEventArgs transfer in transferResult.Transfers)

NLog.LogManager.GetCurrentClassLogger().Trace("Upload of {0} succeeded", transfer.FileName);



sftp.txt (5.04 KB) [Download]

Description: (none)

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Well, startup path is /opt/ftpguests/rcmprod, so I assume you should upload the files to /opt/ftpguests/rcmprod/, not /rcmprod/. The /rcmprod/ does not exist and cannot be created (I assume you do not have permissions to create directories is a root).

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