问题
i'm trying to Copy my file from c:\test to my FTP folder ; This is my code :
import ftplib
import socket
Name = socket.gethostname()
filename = Name +".csv"
ftp = ftplib.FTP('xxxxxxxxxxxxxxxxxx')
ftp.login('xxxxxx','xxxxxxxx')
ftp.cwd('test')
filematch = "C:\\test\\" + Name + ".csv"
filetocopy = open(filematch,'r')
ftp.storlines('STOR' +filename , filetocopy)
but i'm running into an Error :
raise error_perm, resp
ftplib.error_perm: 500 ?
回答1:
Solved:
import ftplib
import socket
Name = socket.gethostname()
filename = Name +".csv"
ftp = ftplib.FTP('xxxxxxxxxxxxxxxxxx')
ftp.login('xxxxxx','xxxxxxxx')
ftp.cwd('test')
filematch = "C:\\test\\" + Name + ".csv"
filetocopy = open(filematch,'r')
ftp.storlines('STOR ' + filename, filetocopy)
来源:https://stackoverflow.com/questions/32261278/python-raise-error-perm-resp-ftplib-error-perm-500