Tuesday, March 6, 2012

Monday, March 5, 2012

How to setup an FTP server on Windows using Python

  1. First download Python. (2.7 because I'm not sure 3.x works with pyftpdlib)
  2. Next download pyftpdlib
  3. Install Python 2.7 from first step. This will usually install to C:\Python27
  4. Install pyftpdlib from the command prompt using Python from C:\Python27\python.exe as follows:
    • Un-tar and uncompress the pyftpdlib-x.y.z.tar.gz using 7zip. (Don't have 7zip? Either download it and install it. Or use something else. :)
    • From the command line, cd into the pyftpdlib.
    • Run the setup script as follows:
      c:\Python27\python.exe setup.py
    • Note that you might have to give the full path because I'm not sure python.exe will be in the environment PATH. Just easier that way.
  5. Write the pyftp.py script. See the tutorial here (or leave a comment if you want me to post a simple one). Change the hostname to your host IP address. (Don't know it? Get it using the ipconfig command.)
  6. Run the pyftp.py script as follows from the command line:
    c:\Python27\python.exe pyftp.py
  7. This should print out the port that your FTP server is running on.
  8. Enjoy the FTP-goodness fun.