LAN file sharing between your PC and phone — similar to Snapdrop. Run a small server on your PC, scan a QR code from your phone, and send files both ways over the same Wi‑Fi network.
Not Django — this project uses Flask, Flask-SocketIO, and plain HTML/CSS/JavaScript.
- PC web UI with QR code for instant phone pairing
- Mobile-friendly phone UI (
/session/<id>) - Choose files buttons on PC and phone (plus drag & drop)
- Shared file list on both devices with download and delete
- Real-time updates via Socket.IO (device join/leave, upload progress)
- Uploads work over HTTP even if live sync is unavailable
- Auto-opens browser on PC when the server starts
- Stale file cleanup (~1 hour)
- Max upload size: 512 MB
- Windows launcher keeps venv, cache, and temp on D: (not C:)
| Item | Details |
|---|---|
| OS | Windows 10/11 for run.bat / stop.bat (server code runs on any OS with Python 3.10+) |
| Python | 3.10 or newer (must be on PATH) |
| Network | PC and phone on the same local Wi‑Fi |
| Location | Project folder at D:\QuickShare (required by the launcher) |
| Browser | Chrome recommended on PC; any modern mobile browser |
Note: Python itself may be installed on C:. Only QuickShare’s project files, venv, uploads, cache, and temp are kept on D:.
| Layer | Technology |
|---|---|
| Backend | Python, Flask 3.x |
| Real-time | Flask-SocketIO (threading mode) |
| QR codes | qrcode + Pillow |
| Frontend | HTML, CSS, vanilla JavaScript |
| Client loader | boot.js (loads Socket.IO from server or CDN fallback) |
| Tests | pytest |
- Place the project at
D:\QuickShare. - Double-click
run.bat.- First run creates
D:\QuickShare\venvand installs dependencies. - Your browser opens
http://localhost:5000.
- First run creates
- On your phone, scan the QR code (same Wi‑Fi as the PC).
- Use Choose files from PC or Choose files from phone to upload.
- Download files from Shared files on the other device.
| Problem | Fix |
|---|---|
| Port already in use | Run stop.bat, then run.bat again |
| Another app uses port 5000 | In run.bat, add: set QUICKSHARE_PORT=5001 (near the top) |
Status shows Offline / io is not defined |
Run stop.bat → run.bat, then Ctrl+F5 on PC; rescan QR on phone |
| Upload does nothing | Hard refresh (Ctrl+F5), rescan QR after server restart |
| Phone shows old session | Always scan the new QR after restarting the server |
| File | Purpose |
|---|---|
run.bat |
Start server; create venv on D:; set temp/cache on D:; free port 5000 if a previous Python instance is running |
stop.bat |
Stop whatever is listening on port 5000 (or QUICKSHARE_PORT) |
cdtoD:\QuickShare- Sets
TMP/TEMP→D:\QuickShare\.tmp - Sets
PIP_CACHE_DIR→D:\QuickShare\.pip-cache - Activates or creates
D:\QuickShare\venv - Installs
requirements.txtif Flask is missing - Kills a previous QuickShare Python process on the port if needed
- Runs
python -m backend.app
cd /d D:\QuickShare
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
set QUICKSHARE_PORT=5000
python -m backend.app| Action | How |
|---|---|
| Connect | Opened automatically by run.bat |
| Upload | Choose files from PC or drag & drop into the drop zone |
| Download | Download in Shared files |
| Delete | × next to a file |
| See activity | Transfer log panel |
| Pair phone | Scan the QR code or open the LAN URL shown |
| Action | How |
|---|---|
| Connect | Scan QR from PC (do not reuse an old tab after restart) |
| Upload | Choose files from phone or drag & drop |
| Download | Download in Shared files (removes file from server after download) |
| Status | Message under the Mobile header (uploading / success / error) |
- Files upload to the PC server via HTTP (
POST /api/upload). - They are saved under
uploads/<session_id>/. - Both PC and phone list the same files via
GET /api/files. - Socket.IO notifies both sides when files change (optional; HTTP still works without it).
Transfers are not direct phone-to-phone (no WebRTC). Everything goes through the PC.
| Variable | Default | Description |
|---|---|---|
QUICKSHARE_PORT |
5000 |
HTTP port |
QUICKSHARE_SECRET |
built-in local value | Flask secret key (set your own for production) |
Set in run.bat before starting, e.g.:
set QUICKSHARE_PORT=5001D:\QuickShare\
├── backend/
│ ├── __init__.py
│ ├── app.py # Flask app, routes, server entry (python -m backend.app)
│ ├── socket.py # Socket.IO events (join, progress, file notifications)
│ └── utils.py # Paths, session IDs, file list/delete, cleanup
├── frontend/
│ ├── index.html # PC UI
│ ├── phone.html # Mobile UI
│ ├── app.js # Upload, download, Socket.IO client logic
│ ├── boot.js # Loads Socket.IO then app.js
│ └── style.css # Dark UI theme
├── static/
│ └── .gitkeep # qr.png generated at runtime (gitignored)
├── tests/
│ ├── conftest.py
│ ├── test_api.py
│ └── test_utils.py
├── uploads/ # Per-session files (gitignored, created at runtime)
├── .tmp/ # Temp files (gitignored)
├── .pip-cache/ # Pip cache on D: (gitignored)
├── venv/ # Python virtualenv on D: (gitignored)
├── run.bat # Start server
├── stop.bat # Stop server on port
├── requirements.txt
├── requirements-dev.txt
├── pytest.ini
├── .gitignore
└── README.md
| Method | Path | Description |
|---|---|---|
| GET | / |
PC homepage |
| GET | /phone |
Phone page (optional; session via query) |
| GET | /session/<session_id> |
Phone entry from QR |
| GET | /api/info |
Server IP, port, session ID, QR URL, connected devices |
| GET | /api/files?session_id= |
List files in session |
| POST | /api/upload |
Multipart upload (file, session_id) |
| GET | /api/download/<session_id>/<filename> |
Download file (?delete=1 removes after send) |
| DELETE | /api/delete/<session_id>/<filename> |
Delete file |
| GET | /static/qr.png |
QR code image |
| GET | /style.css, /app.js, /boot.js |
Frontend assets |
Socket.IO events (examples): join_session, file_upload, file_receive, progress, device_joined, device_left.
| Path | Contents |
|---|---|
uploads/<session_id>/ |
Uploaded files for the current server session |
static/qr.png |
QR image (regenerated each server start) |
.tmp/ |
Windows temp redirected here by run.bat |
.pip-cache/ |
Pip download cache on D: |
- Files older than ~1 hour are auto-deleted (
cleanup_old_filesinutils.py). - Restarting the server creates a new session ID → scan the new QR code.
- Phone downloads use
?delete=1to remove the server copy after download.
cd /d D:\QuickShare
venv\Scripts\activate
pip install -r requirements-dev.txtpytestTests cover utilities and HTTP API (upload, list, download, delete).
Safe to commit: source code, README.md, requirements*.txt, run.bat, stop.bat, pytest.ini, static/.gitkeep, tests.
Do not commit (already in .gitignore):
venv/uploads/static/qr.png.tmp/,.pip-cache/.env__pycache__/,.pytest_cache/
Example:
cd /d D:\QuickShare
git init
git add .
git commit -m "Initial commit: QuickShare LAN file sharing"
git remote add origin https://github.com/YOUR_USER/QuickShare.git
git branch -M main
git push -u origin main- No login or encryption — intended for trusted home/office LANs only.
- Anyone on your Wi‑Fi who knows the URL could access files while the server is running.
- Firewall may block phone access; allow Python on private networks if needed.
- Single active session per server run (one QR at a time).
- Not a cloud service; PC must stay on and server running.
| Symptom | Likely cause | Fix |
|---|---|---|
WinError 10048 |
Port 5000 in use | stop.bat → run.bat |
Offline / io is not defined |
Socket.IO script failed; init crashed | Hard refresh; ensure server is running; boot.js loads CDN fallback |
| Upload succeeds but file not visible | Stale session / old QR | Rescan QR after restart |
| Phone can’t connect | Different Wi‑Fi or firewall | Same network; allow port 5000 |
| Devices (0) | Phone not joined yet | Scan QR and open the session URL |
| Large file fails | Over 512 MB | Split file or raise limit in app.py (MAX_CONTENT_LENGTH) |