J
JL
I have the following code;
try:
session = FTP(ftp_server_ip,ftp_user,ftp_password)
file = open(filename,'rb') # file to send
session.storbinary('STOR ' + filename, file) # send the file
except Exception, errObj:
print Exception
print errObj
file.close() # close file and FTP
session.quit()
I deliberately placed an invalid ip address for the ftp_server_ip to see whether error messages can be caught. However, no exception was thrown. Can someone more experienced point to me what did I do wrong?
Thank you.
try:
session = FTP(ftp_server_ip,ftp_user,ftp_password)
file = open(filename,'rb') # file to send
session.storbinary('STOR ' + filename, file) # send the file
except Exception, errObj:
print Exception
print errObj
file.close() # close file and FTP
session.quit()
I deliberately placed an invalid ip address for the ftp_server_ip to see whether error messages can be caught. However, no exception was thrown. Can someone more experienced point to me what did I do wrong?
Thank you.