Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sctech-tr/sendfile

📜 send and recieve files across the local network
https://github.com/sctech-tr/sendfile

file ftp http http-client http-server internet network pip python python-http python-http-client python-http-server python-httpserver python-package python3 pythonhttpserver

Last synced: about 2 months ago
JSON representation

📜 send and recieve files across the local network

Awesome Lists containing this project

README

        

# 📦 SendFile: File Sharing Across Local Network
SendFile is a Python-based tool that allows you to **send** and **receive files** across your local network. It serves files from the `~/.sendfile/uploads` directory on the server and saves downloaded files in the `~/.sendfile/downloads` directory on the client.
## 🎉 Features
- **Host a File Server**: Easily start a server to share files within your local network.
- **Download Files**: Retrieve files from another device using its local IP address.
- **Lightweight**: Built using Python's standard library (no external dependencies! (except for requests)).
- **Modular**: The app is split into multiple files for maintainability and clarity.

## 🛠 Installation
1. Ensure Python 3.9 or newer is installed.
2. Install via pip:
```bash
pip install sendfile
```
## 🚀 Usage
### Start the Server
Host the server to share files from `~/.sendfile/uploads`:
```bash
python -m sendfile serve --host 0.0.0.0 --port 8000
```
#### Options:
- `--host`: Host to bind the server (default: `0.0.0.0`).
- `--port`: Port to bind the server (default: `80`).
### Download a File
Download a file from a server:
```bash
python -m sendfile download --port 8000
```
#### Example:
```bash
python -m sendfile download 192.168.1.114 my_file.txt --port 8000
```
#### Options:
- ``: Local IP address of the server.
- ``: Name of the file to download.
- `--port`: Port of the server (default: `80`).
## 📜 Using as an HTTP server
You can also use SendFile as an HTTP server. To do this, run the following command:
```bash
python -m sendfile serve --host 0.0.0.0 --port 80
```
## 📂 File Structure
```plaintext
sendfile/
├── __main__.py # Entry point for the application
├── server.py # Server-side implementation
├── client.py # Client-side implementation
├── utils.py # Utility functions (e.g., get local IP)
```
## 🌟 Example Workflow
### Server:
Run the server on one machine:
```bash
python -m sendfile serve
```
Place the file to share in the `~/.sendfile/uploads` directory.

### Client:
Download the file from another machine:
```bash
python -m sendfile download 192.168.1.114 my_file.txt
```
## 🔧 Requirements

- Python 3.9 or newer.
- Both devices must be connected to the same local network.

## 🛡 Security Note
This tool is intended for local network use. Do not expose the server to the public internet without proper security measures.