By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,626 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,626 IT Pros & Developers. It's quick & easy.

Error on FTP Upload .. No such file or directory

P: n/a

-------
Code
------

remotepath = "/incoming"

f = FTP(host)
f.login(username,password)
f.cwd(remotepath)
localfile ="C:\\test.txt"
fd = open(localfile,'rb')
path,filename = os.path.split(localfile)
f.storbinary('STOR %s' % filename,fd)
fd.close()
f.quit()
--------
Error
--------
Traceback (most recent call last):
File "P:\Working\Python code\temp.py", line 21, in ?
uploadFile("C:\\test.txt")
File "P:\Working\Python code\temp.py", line 16, in uploadFile
f.storbinary('STOR %s' % filename,fd)
File "C:\Python23\lib\ftplib.py", line 415, in storbinary
conn = self.transfercmd(cmd)
File "C:\Python23\lib\ftplib.py", line 345, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "C:\Python23\lib\ftplib.py", line 327, in ntransfercmd
resp = self.sendcmd(cmd)
File "C:\Python23\lib\ftplib.py", line 241, in sendcmd
return self.getresp()
File "C:\Python23\lib\ftplib.py", line 214, in getresp
raise error_perm, resp
ftplib.error_perm: 553 test.txt: No such file or directory.

Disclaimer

This e-mail and any attachments is confidential and intended solely for theuse of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not theintended recipient, be advised that you have received this e-mail in errorand that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have receivedthis e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender.
May 17 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.