title: psftp put is throwing error <dir>: open for write: failure when filename is not provided in destination location
body: <p>I am using psftp's put command to upload files. I am not providing the filename in destination location assuming that the file will be copied with the same name. Here's the help page of put command</p>
  
  <pre><code>psftp&gt; help put
  put [ -r ] [ -- ] &lt;filename&gt; [ &lt;remote-filename&gt; ]
  Uploads a file to the server and stores it there under
  the same name, or under a different one if you supply the
  argument &lt;remote-filename&gt;.
  If -r specified, recursively store a directory.
  </code></pre>
  
  <p>If I try to use PUT without filename in the destination location, psftp throws the error <strong>open for write: failure</strong></p>
  
  <pre><code>psftp&gt; open user@host
  Using username "user".
  Remote working directory is /
  psftp&gt; put &lt;file_name&gt; ./&lt;dir&gt;/
  /&lt;dir&gt;: open for write: failure
  </code></pre>
  
  <p>Whereas if I provide the filename in the destination location, it works</p>
  
  <pre><code>psftp&gt; put &lt;file_name&gt; ./&lt;dir&gt;/&lt;file_name&gt;
  local:&lt;file_name&gt; =&gt; remote:/&lt;dir&gt;/&lt;file_name&gt;
  </code></pre>
  
  <p>Why does the PUT command require filename in the destination location?</p>