Here is the corresponding code causing the error.
ftp = ftplib.FTP('server')
ftp.login(r'user', r'pass')
ftp.cwd('incoming')
fileObj = open(fromDirectory + os.sep + f, 'rb')
try:
msg = ftp.storbinary('STOR %s' % f, fileObj)
except Exception as inst:
msg = inst
finally:
fileObj.close()
if '226' not in msg:
I have never seen this error before, and any information on why I can get it will be helpful and appreciated.
full error message: [Errno 10060] Connection attempt failed because the connected side did not respond properly after some time or the connection failed because the connected host was unable to respond
It should be noted that when I manually (i.e. open dos-prompt and click files using ftp commands), click on the file from the same computer where the script is located, I have no problems.
source
share