Python :raise error_perm, resp ftplib.error_perm: 500?

回眸只為那壹抹淺笑 提交于 2021-01-28 02:53:32

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!