Unable to upload a file SFTP using SSH.NET in C# – Permission Denied

You need to specify a full path to upload the file to.

For example:

client.UploadFile(fileStream, "/home/user/" + f.Name, null);

Without the path, the SFTP server probably tries to write the file to a root folder or other folder that you do not have a write access to (hence the Permission denied).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)