starge problem
I have this simple code to upload file to router using Python
Code: Select all
ftp = FTP('10.0.0.1', timeout=60)
try:
ftp.login(user='user', passwd='pass')
except error_perm as msg:
print(f"FTP error: {msg}")
return "Wrong User or Password"
except Exception as e1:
print(e1)
print("Error in FTP Login!")
return "Unknown Error"
else:
try:
file_to_upload = open(filename, 'rb')
ftp.storbinary('STOR test.txt', file_to_upload)
UploadOk = "OK"
return "FTP success"
except Exception as e:
print('my error')
print(e)
UploadOk = "Problem"
return "FTP Error " + str(e)
finally:
print("status " + UploadOk)
file_to_upload.close()
ftp.close()
when I run the code for router on version 6.47 - the file is uplaod and working
when I try to use older version 6.36 \ 6.40
I can see it mange to enter the router but unablr to uplaod the file
this is the error I'm getting
Code: Select all
FTP Error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
what could be the reason for it ?