Tuesday, 20 August 2013

Cannot write to Twisted FTP server

Cannot write to Twisted FTP server

I am currently using the one-line Twisted FTP server to transfer files
back and forth between machines:
twistd -n ftp
Which works fine for downloading files from the server. However when I try
to write to the server using:
with open('testFile.bmp', 'rb') as f:
ftp.storbinary('STOR ' + 'testFile.bmp', f)
with open('surrogate.py', 'rb') as f:
ftp.storbinary('STOR ' + 'surrogateCode.py', f)
I get errors:
Traceback (most recent call last):
File "client.py", line 13, in <module>
ftp.storbinary('STOR ' + 'testFile.bmp', f)
File "/usr/lib/python2.7/ftplib.py", line 461, in storbinary
conn = self.transfercmd(cmd, rest)
File "/usr/lib/python2.7/ftplib.py", line 368, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "/usr/lib/python2.7/ftplib.py", line 331, in ntransfercmd
resp = self.sendcmd(cmd)
File "/usr/lib/python2.7/ftplib.py", line 244, in sendcmd
return self.getresp()
File "/usr/lib/python2.7/ftplib.py", line 219, in getresp
raise error_perm, resp
ftplib.error_perm: 550 Requested action not taken: internal server error
I tried it with the WinSCP FTP client and receive this error:
Copying files to remote side failed.
Requested action not taken: internal server error
I'm not sure if I am writing incorrectly or calling the server incorrectly.

No comments:

Post a Comment