Question

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()
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top