title: Rebex SFTP error in C#: Permission denied on PutFile
body: <pre><code>string msg = &quot;Writing to file.&quot;;
  byte[] data = System.Text.Encoding.Default.GetBytes(msg);
  System.IO.MemoryStream mem = new System.IO.MemoryStream(data);
  ftpClient.PutFile(mem,&quot;file.txt&quot;);
  </code></pre>
  <p>While I connect with no issue, I've been receiving this exception that I don't quite understand:</p>
  <blockquote>
  <p>An unhandled exception of type 'Rebex.Net.SftpException' occurred in Rebex.Sftp.dll</p>
  <p>Additional information: Permission denied; Permission denied.&quot;</p>
  </blockquote>