The server response "Permission denied", how to fix it?
Hello,
I use these code to upload the file:
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.
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.