4

I am trying to run an ftp server in python using pyftpdlib module. The problem occurring is that it shows a "150 File status okay. About to open data connection." and then just stays like that forever until the server time's out.

I log in through cmd , using the ftp command.

PLs help.

Here is the server code:

import os
import sqlite3
from pyftpdlib import ftpserver


def main():

    authorizer = ftpserver.DummyAuthorizer()

    ftp_auth_table="H:\\ftp_auth_table1.db"
    connection=sqlite3.connect(ftp_auth_table,isolation_level=None)
    cursor=connection.cursor()
    cursor.execute('''SELECT * FROM ftp_auth_table1''')
    entry=cursor.fetchall()
    # change os.gtcwd() with ftp_actv_dir
    for x in entry:
        authorizer.add_user(x[1], x[2], "H:/MS EVERYTHING", perm='elradfmwM')


    # Instantiate FTP handler class
    handler = ftpserver.FTPHandler
    handler.authorizer = authorizer


    handler.banner = "pyftpdlib %s based ftpd ready." %ftpserver.__ver__


    address = ('127.0.0.1', 21)
    ftpd = ftpserver.FTPServer(address, handler)

    ftpd.max_cons = 256
    ftpd.max_cons_per_ip = 5

    # start ftp server
    ftpd.serve_forever()

if __name__ == '__main__':
    main()
tshepang
  • 12,111
  • 21
  • 91
  • 136
thecreator232
  • 2,145
  • 1
  • 36
  • 51
  • 1
    I suspect the homedir in `authorizer.add_user` is confusing the client, spaces are notoriously troublesome. Giving the server trace you get as shown in http://code.google.com/p/pyftpdlib/#Quick_start would be helpful. – msw Jul 15 '12 at 09:30

1 Answers1

1

I predict, with absolute confidence, that you'll find the problem is due to the space between "MS EVERYTHING".

msw
  • 42,753
  • 9
  • 87
  • 112