This project is a TCP-based file transfer system that allows a client to interact with a server to perform various file operations such as listing files, uploading, downloading, deleting, and changing directories. The project consists of a server (server.py
) and a client (client.py
) implemented in Python.
- List Files: View the list of files available on the server.
- Upload Files: Upload a file from the client to the server.
- Download Files: Download a file from the server to the client.
- Delete Files: Delete a file from the server.
- Change Directory: Change the client's working directory.
- Help: Get a list of available commands.
- Logout: Disconnect from the server.
- Python 3.x
- Network connection between the server and the client machines.
File-transfer-server-client/
│
├── server.py
├── client.py
└── README.txt
-
Clone the Repository
git clone https://github.com/Sriram19g/File-transfer-server-client.git cd File-transfer-server-client
-
Set Server and Client Data Paths
Make sure to update the
SERVER_DATA_PATH
inserver.py
and theCLIENT_DATA_PATH
inclient.py
to valid directories on your machine. -
Run the Server
On the server machine, run:
python3 server.py
The server will start and listen for incoming connections on the specified IP and port.
-
Run the Client
On the client machine, run:
python3 client.py
The client will connect to the server and you can start issuing commands.
-
LIST: List all the files from the server.
LIST
-
UPLOAD : Upload a file to the server.
UPLOAD example.txt
-
DOWNLOAD : Download a file from the server.
DOWNLOAD example.txt
-
DELETE : Delete a file from the server.
DELETE example.txt
-
CHANGEDIR : Change the client's working directory.
CHANGEDIR /path/to/new/directory
-
LOGOUT: Disconnect from the server.
LOGOUT
-
HELP: Get a list of available commands.
HELP
-
CLEAR: Clear the screen.
CLEAR
-
VIEW: View files in the client's current directory.
VIEW
Welcome to the File Server.
SERVER : ('192.168.1.10', 8888)
MYADDR : ('192.168.1.15', 12345)
---> LIST
[SERVER] : The files in the server directory are
*example.txt
*data.csv
---> UPLOAD newfile.txt
[SERVER] : File uploaded successfully.
---> DOWNLOAD example.txt
The file downloaded successfully.
---> DELETE data.csv
[SERVER] : The file is deleted successfully.
---> LOGOUT
[SERVER] : Disconnected from the Server.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit a pull request.
- Python documentation: https://docs.python.org/3/
- Socket programming resources and examples.
For any questions or feedback, please contact gsriram200@gmail.com.
Feel free to customize this README.txt
file further according to your needs. This template provides a comprehensive overview of the project and its usage, which should be helpful for anyone looking to understand and use your File-Transfer-Server-Client system.