Code Monkey home page Code Monkey logo

cpsc471-ftp-project's Introduction

FTP Server & FTP Client

Python application allowing a client to upload & download files to & from server


    For CPSC 471 - Computer Communication at California State University Fullerton

    Spring 21'




Table of contents



Overview

  • This application allows a client to connect to an FTP server
  • The FTP server will then allow the client to:
    • Upload a file to the server
    • Download an existing file from the server
    • Close the FTP connection and exit program
  • SPECIAL NOTE: When running through Tuffix, socket functions that retrieved addresses would be different (127.0.0.1 and 127.0.1.1). This caused connectivity issues and would recommend running on any another OS.
      Please read the instructions section below before proceeding.


Instructions

    1.   Download this repository and locate the folder on your computer

    2.   Before proceeding, ensure you have all the following files:

           serv.py cli.py client-data.txt and the uploads subfolder containing server-data.txt

    3.   Open two terminals in your OS. One of these servers will be the server, and the other will be the client.

    4.   In one of your terminals run the serv.py script using the following command:

           python3 serv.py <PORT_NUMBER>

           The server name will be printed to the terminal. Copy this, you will need it for the next step

    5.   In the other terminal, run your cli.py script using the following command:

           python3 cli.py <server_name> <PORT_NUMBER>

    6.   Once both scripts are running, your client terminal will prompt you to enter one of four ftp commands:

           ls - the server will send a string of file names to the client
           get <file_name> - the server will send a file name to the client
           put <file_name> - the server will recieve the specified filename from the client
           close - the server will close the FTP connection after receiving this command from the client
  • Once a command is entered, the server will listen for the file name, open the data channel and finally respond accordingly to the command inputted by the client.

  • As noted above, when you are ready to close the session, simply type "close" in the ftp prompt of your client terminal.



File Structure

  • CPSC471-ftp-project
    • serv.py - Handles server-side communication with FTP connection
    • cli.py - Handles client-side communication with FTP connection
    • client-data.txt - This represents the default client data
    • uploads - This represents the server directory location


Demo

    LS Command

      ezgif com-optimize

       As expected, the server only returns server-data.txt, the default server data

    PUT Command

      ezgif com-optimize

       Here we upload client-data.txt to the server
       i.e. client-data.txt can now be found in uploads

    LS Command

      ezgif com-optimize

       Now the server returns server-data.txt and also client-data.txt since we just sent it to the server in the step above

    GET Command

      ezgif com-optimize

       Here we request and download server-data.txt from the server to the clients computer



Thanks for reading!

If you like what you see give this repo
a star and share it with your friends.

Your support is greatly appreciated!



cpsc471-ftp-project's People

Contributors

dguido1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.