i'm writing an application that is supposed to upload a file to an FTP server.
Here's the code:
try:
f = open(filename,"rb")
except:
print "error 0"
try:
ftp = FTP(str(self.ConfigUri))
print "CONNECTED!"
except:
print "CANNOT CONNECT"
try:
ftp = FTP(str(self.ConfigUri)) # connect to host, default port
except:
print "error 1"
try:
ftp.login() # user anonymous, passwd anonymous@
except:
print "error2"
try:
ftp.storbinary('STOR ' + filename, f)
except:
print "error 3"
try:
ftp.quit()
except:
print "error 4"
I am getting an error at ftp.storbinary('STOR ' + filename, f). Any ideas why?