LAN 文件传输
局域网 AirDrop —— 打开浏览器,拖拽文件,搞定。
一个用 Python 写的局域网文件传输工具。在电脑上启动一个轻量 HTTP 服务,局域网内任何设备用浏览器打开 http://IP:8765 就能上传/下载文件。
- 🚀 直连满速 — 瓶颈只有你的路由器/网卡速率
- 📦 零限制 — 文件大小、类型、数量,通通没限制
- 🌐 跨平台接收 — 发文件的是 Windows,接收端可以是任何有浏览器的设备
- 🎨 现代 Web UI — 拖拽上传、实时进度、二维码分享、粘贴即上传
- ⚡ 零依赖 — 只用到 Python 标准库,不需要 pip install 任何东西
快速开始
# 命令行版本
python lan_transfer.py
# 或 GUI 版本(双击启动)
python lan_transfer_gui.py
# 或打包好的 EXE
LAN文件传输.exe
启动后,在同一局域网的任意设备浏览器中输入显示的网址(如 http://192.168.1.179:8765),即可开始传输。
打包为 EXE
pip install pyinstaller
pyinstaller --onefile --windowed lan_transfer_gui.py
# EXE 输出在 dist/ 目录
特性
| 功能 | 说明 |
|---|---|
| 拖拽上传 | 网页拖拽文件即可上传,支持批量 |
| 粘贴上传 | 截图后 Ctrl+V 直接贴到网页上传 |
| 实时进度 | 上传进度条 + 实时速度显示 |
| 二维码 | 生成二维码,手机扫码直接打开 |
| 文件管理 | 在线预览/下载/删除共享文件 |
| 图片预览 | 图片文件自动生成缩略图 |
| 跨平台 | 服务端 Windows,接收端 Mac/Linux/手机均可 |
技术架构
- 后端: Python
http.server+socketserver.ThreadingMixIn - 前端: 内联 SPA(HTML + CSS + JS,无外部依赖)
- 传输: HTTP 流式上传/下载,1MB 分块
- 打包: PyInstaller → 单文件 EXE(约 11MB)
许可证
MIT License
Metadata
Release files for lan-transfer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lan_transfer-0.1.0.tar.gz | 27.6 kB | Without provenance | Details for lan_transfer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lan_transfer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lan_transfer-0.1.0-py3-none-any.whl |
Total release size: 56.2 kB
Release files / lan_transfer-0.1.0.tar.gz
| Download URL | lan_transfer-0.1.0.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0a1ab0b342898ea5124f942e370ebc34114b89290a2aa75a234c75c4b8d6058
|
|
BLAKE2b-256 checksum How to use checksums |
a3aed54fbe9998fd37b0fde09e0ac1d319839e51c1162496a52994f55f2b9a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / lan_transfer-0.1.0-py3-none-any.whl
| Download URL | lan_transfer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b27e4e6afa2e0e1d1c44eaec73e211ba4aadf732f055371cffd13db2568ccf55
|
|
BLAKE2b-256 checksum How to use checksums |
c0771738ffd4c6782d3f75b52f60a3fc5cb61a29a4a0a42ab9c6b56c1d98e2ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for lan-transfer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.