This is a FastAPI web application that serves as a platform for sharing files between a server and a client.
The application creates uploads
and downloads
directories on the running directory,
enabling seamless file sharing via a web browser.
- File Download: Clients can access and download files placed in the
uploads
folder on the server by opening the URL in a web browser (http://<server_ip>:<port>
). - File Upload: Clients can upload files via the browser, and the uploaded files will be placed
in the
downloads
folder on the server.
- Python: Version 3.12 or higher
- Python venv
- Docker (optional, for containerized deployment)
sudo apt install python3
sudo apt install python3.12-venv
sudo apt install docker
- Build the Docker image:
docker build -t sharefile-app .
- Run the Docker container:
docker run -it --rm -u u1 -p 8000:8000 -v $(pwd):/app sharefile-app
- Create a virtual environment:
python3 -m venv myenv
- Activate the virtual environment:
source myenv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn sharefile:app --host 0.0.0.0 --port 8000 --reload
-
Access the Application: Open your browser and navigate to
http://<server_ip>:8000
. -
File Sharing:
- Place files in the
uploads
folder for clients to download. - Clients can upload files, and the uploaded files will be stored in the
downloads
folder.
- Place files in the