A multi-client file transfer system built with Python, featuring a robust client-server architecture for handling concurrent file operations.
- User Authentication: Secure client login based on a predefined username and password list.
- Concurrent Client Handling: Uses a thread pool to manage multiple client connections simultaneously without data loss.
- User-Specific Storage: Automatically creates and manages a dedicated storage directory for each authenticated user.
- File Operations:
- Upload: Securely upload files to the user's dedicated directory.
- Download: Download files from the server.
- Preview: View the first 1024 bytes of a file without downloading the entire content.
- Delete: Remove files from the user's server-side directory.
- Performance Logging: Tracks server performance, including connections and file transfer metrics, to a log file.
- Graceful Shutdown: A signal handler ensures the server can shut down safely, logging final performance stats.
- Python 3
- socket: For core network communication.
- threading &
ThreadPoolExecutor: For handling multiple clients concurrently. - os: For file system operations on the server.
- logging: For detailed performance and event logging.
- psutil: To monitor system resources (CPU/Memory) on shutdown.
-
Clone the repository:
git clone https://github.com/sumukhacharya03/DFOS.git cd DFOS -
Configure Users: Edit the
id_passwd.txtfile to add or change user credentials.user1:password123 user2:newpassword -
Start the Server: Open a terminal and run the server script.
python server.py
The server will start listening on port 5000.
-
Run the Client: Open a second terminal to run the client.
python client.py
You will be prompted for your username and password to connect.