Hey guys, hope someone can help with this as i've run out of resources. Just trying to upload a simple .txt script to a FTP server. This is what i've come down to...
Code:
from ftplib import FTP
fo=open("foo.txt", "wb")
fo.write("hello world")
fo.close()
FTP=FTP('ftp.ftpsite.com')
FTP.login(user='0men', passwd='password123')
FTP.storlines("STOR, foo.txt", "f")
FTP.quit()
FTP.close()
I've chopped and changed this code around, but still cant get anything, apart from errors, such as this..
Code:
line 14, in <module>
FTP.storlines("STOR, foo.txt", "f")
File "C:\Python27\lib\ftplib.py", line 483, in storlines
conn = self.transfercmd(cmd)
File "C:\Python27\lib\ftplib.py", line 368, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "C:\Python27\lib\ftplib.py", line 331, in ntransfercmd
resp = self.sendcmd(cmd)
File "C:\Python27\lib\ftplib.py", line 244, in sendcmd
return self.getresp()
File "C:\Python27\lib\ftplib.py", line 219, in getresp
raise error_perm, resp
error_perm: 501 Syntax error: Command not understood.
Thanks in advance, hoping someone can help.