| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simple tool for transferring files over a WiFi network using TCP sockets — no cloud services or external dependencies. WiFile lets you quickly send files between devices on the same network from the command line or from a browser (python webui.py, see Web UI).
WiFile operates in two modes: server (sender) and client (receiver). Prefer a browser? Run python webui.py and open the page it prints — the web UI and the CLI use the same engine and are fully interchangeable (see Web UI).
Run this on the device that has the file you want to send:
python wifile.py server --file /path/to/your/file.txtIf you run python wifile.py server without --file or --folder, the server prompts you to enter a file or folder path before it starts listening.
Send all files inside a folder (including subfolders) one by one over a single connection:
python wifile.py server --folder /path/to/your/folderFiles are transferred sequentially in a batch. The client receives each file and recreates the folder structure in its output directory.
Optional parameters:
Examples:
python wifile.py server --file document.pdf --port 8080
python wifile.py server --folder ./photos --port 8080Persistent server: the server does not exit after a transfer. After each transfer it prompts for what to serve next:
- s - send the same file(s)/folder again
- n - provide a new file or folder path to send
- e - exit the server
Press Ctrl+C in the server terminal to stop at any time.
Run this on the device that will receive the file:
python wifile.py client --host <server-ip-address>Optional parameters:
Examples:
python wifile.py client --host 192.168.1.100 --port 8080 --output-dir ./downloads
python wifile.py client --host 192.168.1.100 --overwrite
python wifile.py client --host 192.168.1.100 --auto-renamePersistent client: the client does not exit after a download. After each batch it prompts for what to do next:
- c - continue saving to the current output location
- n - set a new output location for the next batch
- e - exit the client
Press Ctrl+C in the client terminal to stop at any time.
python wifile.py server --file myfile.zipOutput:
Server listening on port 12345
Server IP address: 192.168.1.50
Clients can connect using: python wifile.py client --host 192.168.1.50
Waiting for connection...
Connected by ('192.168.1.100', 55124)
Sending 'myfile.zip' (2.3 MB)...
|████████████████████████████████████████████████████| 100.0% (2.3 MB/2.3 MB) - 1.2 MB/s - ETA: 0s
File 'myfile.zip' sent successfully.
python wifile.py client --host 192.168.1.50Output:
Connected to server 192.168.1.50:12345 Receiving 'myfile.zip' (2.3 MB)... |████████████████████████████████████████████████████| 100.0% (2.3 MB/2.3 MB) - 1.2 MB/s - ETA: 0s File 'myfile.zip' received and saved to './myfile.zip'.
| Option | Description | Required | Default |
|---|---|---|---|
| --file | Path to the file to send | No (prompted if omitted) | - |
| --folder | Path to the folder whose contents to send one by one (recurses into subfolders) | No (prompted if omitted) | - |
| --port | Port number to listen on | No | 12345 |
| Option | Description | Required | Default |
|---|---|---|---|
| --host | IP address of the server | Yes | - |
| --port | Port number to connect to | No | 12345 |
| --output-dir | Directory to save received file(s) | No | Current directory |
| --overwrite | Automatically overwrite existing files | No | False |
| --auto-rename | Automatically rename if file exists | No | False |
When the server runs with --folder, it sends every file inside the folder (recursively) one by one over a single connection, using a framed wire protocol: each control message is 1-byte type + 4-byte length + payload. The server announces the file count, then for every file it sends a header (name + size), the client resolves any name conflicts and signals it is ready, the server streams the file, and the client confirms the file was written before the next one starts. Subfolder structure is preserved on the receiving side. No action is needed on the client - it automatically detects a batch transfer and keeps receiving until done.
For folder transfers, steps 4-8 repeat for each file in the folder. The server first announces how many files it will send, then sends each file sequentially with a per-file completion confirmation, and finally signals the end of the batch. Subfolder structure is preserved on the receiving side. No action is needed on the client - it automatically detects a batch transfer and keeps receiving until done.
After a client disconnects (transfer finished or aborted), the server asks whether to send the same file(s)/folder again, switch to a new file or folder, or quit. Run it in its own terminal and press Ctrl+C to stop it.
The client stays running too: after each download it asks whether to keep the current output location, switch to a new one, or exit.
When a file with the same name already exists on the client side, WiFile provides three options:
Warning: File 'document.pdf' already exists in './downloads' Choose action: (o)verwrite, (r)ename, (c)ancel: r Saving as 'document_1.pdf' instead...
--overwrite and --auto-rename are mutually exclusive; passing both is an error. Likewise, --file and --folder cannot be combined on the server.
WiFile shows real-time transfer progress with:
WiFile automatically displays the server's IP address when it starts, but you can also find it manually:
Windows:
ipconfigmacOS/Linux:
ifconfig
# or
ip addr showLook for the IP address under your WiFi adapter (usually starts with 192.168.x.x or 10.x.x.x for local networks).
⚠️ Important: This tool is designed for use on trusted local networks only.
WiFile also ships with a browser-based interface, so any device on the network — laptop, tablet, or phone — can send and receive files without installing anything.
python webui.pyThen open http://127.0.0.1:8765 in a browser. The page has two panes:
Options:
If the requested port is unavailable (common on Windows, where some ports are reserved by the system), WiFile automatically falls back to a free port and prints the actual address.
When you bind to a non-loopback address (--host 0.0.0.0), the console also prints the page's LAN URLs (e.g. http://192.168.1.50:8765), so you can open the UI from another device — the Receive pane then has the sender's address pre-filled for you.
⚠️ The web UI binds to localhost by default. With --host 0.0.0.0, anyone who can reach the page can make this machine send arbitrary local files — there is no authentication. Only expose it on trusted networks.
The web UI uses the same transfer engine and wire protocol as the CLI, so the two are fully interchangeable: a browser sender works with a CLI receiver and vice versa.
"Connection refused"
"File does not exist"
"Permission denied"
"Connection lost during transfer"
"UTF-8 codec can't decode"
"File already exists" prompts
Feel free to submit issues, fork the repository, and create pull requests for any improvements.
This project is open source. Please check the repository for license details.
| Back | FazBrowse Home | New Git URL |