title: error_perm: 550 Permission denied
body: <p>I'm learning web programming with Python, and still basically going through lectures/tutorial.</p>
  
  <p>I'm trying to upload a file to a server. This is my code:</p>
  
  <pre><code>import ftplib
  import sys
  
  filename = sys.argv[1]
  connect = ftplib.FTP("***.**.***.**")
  connect.login("testuser","pass")
  file = open(filename, "rb")
  connect.storbinary("STOR " + filename, file)
  connect.quit()
  </code></pre>
  
  <p>and this is the error I have:</p>
  
  <pre><code>File "C:\Users\test\putfile.py", line 8, in &lt;module&gt;
     connect.storbinary("STOR " + filename, file)
  File "C:\Python27\lib\ftplib.py", line 471, in storbinary
     conn = self.transfercmd(cmd, rest)
  File "C:\Python27\lib\ftplib.py", line 376, in transfercmd
     return self.ntransfercmd(cmd, rest)[0]
   File "C:\Python27\lib\ftplib.py", line 339, in ntransfercmd
     resp = self.sendcmd(cmd)
   File "C:\Python27\lib\ftplib.py", line 249, in sendcmd
     return self.getresp()
   File "C:\Python27\lib\ftplib.py", line 224, in getresp
     raise error_perm, resp
   ftplib.error_perm: 550 Permission denied.
  </code></pre>
  
  <p>testuser should have the permission to write files, since the folder is owned by him, and he has root privilege(was added in sudoer file).</p>
  
  <p>the same thing happens if I add the line:</p>
  
  <pre><code> connect.cwd('/testfolder')
  </code></pre>
  
  <p>I will get error_perm: 550 Failed to change directory.</p>
  
  <p>However I can still read the existing files just fine (with 
  connect.retrlines("RETR " + filename))</p>
  
  <p>I'm pretty new about Python as well as Linux, so I don't have idea what I'm doing. I need some help.</p>