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

Author Message
[View user's profile]

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

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";

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

   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?

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Are you able to upload the files to that folder using any (even GUI) SFTP client?

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