FAQ
Hi all,
?
I am trying to put together a script (Python 2.5, windows xp) that connects to an ftp server and retrieves/uploads files.
?
I am sure what I have put together is completely insufficient and I get the errors:
?
Traceback (most recent call last):
? File "C:\Documents and Settings\\Desktop\FTPDownload.py", line 19, in <module>
??? ftp.login('username', 'password')
? File "C:\Python25\lib\ftplib.py", line 373, in login
??? if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd)
? File "C:\Python25\lib\ftplib.py", line 241, in sendcmd
??? return self.getresp()
? File "C:\Python25\lib\ftplib.py", line 216, in getresp
??? raise error_perm, resp
error_perm: 530 User?username cannot log in.
?
The script I have so far is :
?
from ftplib import FTP
def handleDownload(block):
??? file.write(block)
??? print ".",
???
ftp = FTP('servername')
# Log in to the server
print 'Logging in.'
# Specify username and password
ftp.login('username', 'password')
print ftp.login()
directory = '/test/ftp/'
# Change to that directory.?
print 'Changing to ' + directory
ftp.cwd(directory)
# Print the contents of the directory
ftp.retrlines('LIST')
?
?
but i cannot even connect to the FTP not to mention upload/download anything...So any ideas or suggestions would be greatly appreciated.
?
Thanks!
?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110225/77ea159d/attachment.html>

Search Discussions

  • Chris Rebert at Feb 25, 2011 at 6:03 pm

    On Fri, Feb 25, 2011 at 6:37 AM, sofia stouki wrote:
    Hi all,

    I am trying to put together a script (Python 2.5, windows xp) that connects to an ftp server and retrieves/uploads files.

    I am sure what I have put together is completely insufficient and I get the errors:

    Traceback (most recent call last):
    ? File "C:\Documents and Settings\\Desktop\FTPDownload.py", line 19, in <module>
    ??? ftp.login('username', 'password')
    ? File "C:\Python25\lib\ftplib.py", line 373, in login
    ??? if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd)
    ? File "C:\Python25\lib\ftplib.py", line 241, in sendcmd
    ??? return self.getresp()
    ? File "C:\Python25\lib\ftplib.py", line 216, in getresp
    ??? raise error_perm, resp
    error_perm: 530 User?username cannot log in.

    The script I have so far is :

    from ftplib import FTP
    def handleDownload(block):
    ??? file.write(block)
    ??? print ".",

    ftp = FTP('servername')
    # Log in to the server
    print 'Logging in.'
    # Specify username and password
    ftp.login('username', 'password')
    print ftp.login()
    directory = '/test/ftp/'
    # Change to that directory.
    print 'Changing to ' + directory
    ftp.cwd(directory)
    # Print the contents of the directory
    ftp.retrlines('LIST')


    but i cannot even connect to the FTP not to mention upload/download anything...So any ideas or suggestions would be greatly appreciated.
    Looks like your username-password pair is invalid. Have you checked
    whether your credentials work using another FTP client? Have you
    checked whether you need to securely login using TLS?

    Cheers,
    Chris

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 25, '11 at 2:37p
activeFeb 25, '11 at 6:03p
posts2
users2
websitepython.org

2 users in discussion

Sofia stouki: 1 post Chris Rebert: 1 post

People

Translate

site design / logo © 2022 Grokbase