Topic "The server response "Permission denied", how to fix it?"

Author Message
Diandian
[View user's profile]

Joined: 2016-05-12
Posts: 1
Hello,
I use these code to upload the file:
Code:

SessionOptions sessionOptions = new SessionOptions
{
   Protocol = Protocol.Sftp,
   HostName = "devserver",
   UserName = "ftpClient",
   Password = "123456",
   SshHostKeyFingerprint = "ssh-rsa 1024 63:3d:d2:6e:19:f5:2b:e4:be:02:3b:5b:ab:d3:75:9a"
};

using (Session session = new Session())
{
   session.DisableVersionCheck = true;
   session.SessionLogPath = @"d:\winscpLog.txt";
   session.Open(sessionOptions);

   TransferOptions transferOptions = new TransferOptions();
   transferOptions.TransferMode = TransferMode.Binary;
   TransferOperationResult transferResult;
   transferResult = session.PutFiles(@"D:\Cache\DCCV2\*", "/home/ftpClient/", false, transferOptions);

   transferResult.Check();
   foreach (TransferEventArgs transfer in transferResult.Transfers)
   {
      Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
   }
}


But response error: can not create folder '/home/ftpClinet/xxx/', error code:3, Permission denied.
The server SSHd set SFTP home path is "E:\FTP".

My question is:
How to write the remotePath?
How to fix this permission denied?

Thanks.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Are you able to upload the files to that folder using any (even GUI) SFTP client?
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