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

Advertisement

Diandian
Joined:
Posts:
1

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

Hello,
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";
   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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

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

Are you able to upload the files to that folder using any (even GUI) SFTP client?

Reply with quote

Guest

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

Hello

I am getting Permission Denied error, but when I upload same file to same directory on SFTP using Internet explorer, then it works successfully.

Is there any setting i am missing?

Thanks

Reply with quote

martin
Site Admin
martin avatar

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

Internet Explorer does not support SFTP. It supports FTPS (FTP over TLS/SSL). What is a completely different protocol.
You are possible using a different protocol in WinSCP than in IE.

Reply with quote

Advertisement

You can post new topics in this forum