Error on FTP Upload .. No such file or directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tarun Kapoor

    #1

    Error on FTP Upload .. No such file or directory


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

    remotepath = "/incoming"

    f = FTP(host)
    f.login(usernam e,password)
    f.cwd(remotepat h)
    localfile ="C:\\test.t xt"
    fd = open(localfile, 'rb')
    path,filename = os.path.split(l ocalfile)
    f.storbinary('S TOR %s' % filename,fd)
    fd.close()
    f.quit()


    --------
    Error
    --------
    Traceback (most recent call last):
    File "P:\Working\Pyt hon code\temp.py", line 21, in ?
    uploadFile("C:\ \test.txt")
    File "P:\Working\Pyt hon code\temp.py", line 16, in uploadFile
    f.storbinary('S TOR %s' % filename,fd)
    File "C:\Python23\li b\ftplib.py", line 415, in storbinary
    conn = self.transfercm d(cmd)
    File "C:\Python23\li b\ftplib.py", line 345, in transfercmd
    return self.ntransferc md(cmd, rest)[0]
    File "C:\Python23\li b\ftplib.py", line 327, in ntransfercmd
    resp = self.sendcmd(cm d)
    File "C:\Python23\li b\ftplib.py", line 241, in sendcmd
    return self.getresp()
    File "C:\Python23\li b\ftplib.py", line 214, in getresp
    raise error_perm, resp
    ftplib.error_pe rm: 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.


Working...