transfer.sh
一个命令行文件速传工具,支持多种存储后端,可自托管,通过curl一键上传下载。
命令行传文件,自托管更安全
核心功能
- 通过 curl 一条命令上传、下载、删除文件
- 支持 S3、Google Drive、Storj 和本地文件系统
- 可设置下载次数上限和保留天数,文件到期自动删除
- 支持服务器端 AES256 加密(需自托管)
- 集成 VirusTotal 病毒扫描
避坑指南
- •官方提示:不要依赖公共实例的服务器端加密(X-Encrypt-Password)——加密密钥存于服务器,自托管才安全,默认无用户认证,建议配合反向代理或添加HTTP基本认证,上传文件大小受限于后端存储,S3等有配额需自行注意,公共实例 transfer.sh 与开源仓库无直接支持关系,建议自行搭建
适用场景
- 开发者快速分享日志、调试文件给同事
- 系统管理员在服务器之间传输配置或备份文件
- 需要临时分享敏感文件,设置自动销毁时限
- 自建文件分享服务,不依赖第三方平台
详细介绍
transfer.sh 是一个开源命令行文件共享工具,让您通过终端快速安全地传输文件。它提供简洁的HTTP API,支持使用curl上传、下载、加密和删除文件。支持多种存储后端:Amazon S3、Google Drive、Storj 和本地文件系统。功能包括密码保护加密、下载次数限制、定时自动删除以及VirusTotal病毒扫描。您可以自建服务器,完全掌控数据。适合开发者、系统管理员以及任何习惯终端操作、不想依赖第三方服务的用户。该项目用Go编写,轻量级,支持Docker一键部署。
常见问题与排障 (1)
故障排除## Why this happens
This behavior is actually expected once you understand the flow:
- curl's "100%" progress bar only means **your client finished sending the bytes**. It says nothing about what the server did with them.
- transfer.sh only sends its HTTP response **after** it has received the file *and* written it to its storage backend (local disk, S3, etc.) and generated a token.
- An HTTP 500 means that final server-side step failed, so no download link was ever generated. Your upload was essentially discarded.
## Common causes
1. **The public instance is overloaded or broken.** The hosted `transfer.sh` service has historically been unstable and frequently returns 500s under load. This is the most common cause.
2. **File too large.** The public instance has a size cap (historically ~10 GB), and self-hosted instances may set lower limits. The server often accepts the whole stream, then fails when finalizing.
3. **Server-side storage failure.** Disk full, unwritable temp directory, or a failing S3/GCS backend.
4. **Timeout during post-upload processing** (reverse proxy or backend storage), especially with large files on slow connections.
5. **Transient error** — often a simple retry succeeds.
## How to diagnose
Run with verbose output and read the **response body** — transfer.sh usually returns an error message there:
```bash
curl -v --upload-file myfile.tar.gz https://transfer.sh/myfile.tar.gz
```
Test with a tiny file to isolate size-related failures:
```bash
echo test > t.txt && curl --upload-file t.txt https://transfer.sh/t.txt
```
- Small file works, large file fails → size limit or timeout.
- Small file also fails with 500 → the server itself is broken; retry later or use another instance.
## Workarounds
- **Retry** a few times — transient 500s are common.
- **Split large files:**
```bash
split -b 2G bigfile.iso part_
```
- **Self-host** (it's open source):
```bash
docker run -d -p 8080:8080 dutchcoders/transfer.sh
curl --upload-file myfile http://localhost:8080/myfile
```
If your self-hosted instance 500s, check `docker logs`, `df -h` for disk space, write permissions on the basedir, and your storage provider config.
- **Use an alternative service**, e.g.:
```bash
curl -F'file=@myfile' https://0x0.st
```
Also consider adding `--fail` and `--retry 3` to your curl command so failures exit non-zero and are retried automatically in scripts.
这是 transfer.sh 服务端的故障,而不是本地上传问题。上传失败可能会返回 HTTP 500,并显示 Could not save metadata,包括在使用 curl -vT file.txt https://transfer.sh 时。一位维护者已确认该服务不可用(issue #594)。目前没有客户端的解决办法;请等待服务恢复后稍后重试。在脚本中依赖 transfer.sh 之前,请先检查其服务状态或其 GitHub issues,如果需要立即分享文件,请使用其他文件传输服务。
标签
快速上手
安装软件
双击下载的安装程序,按提示完成安装
步骤1:安装 Docker 或直接下载二进制
步骤2:运行命令:docker run -p 8080:8080 dutchcoders/transfer.sh
步骤3:使用 curl 上传文件:curl --upload-file ./myfile.txt http://your-ip:8080/myfile.txt
- 步骤1:安装 Docker 或直接下载二进制
- 步骤2:运行命令:docker run -p 8080:8080 dutchcoders/transfer.sh
- 步骤3:使用 curl 上传文件:curl --upload-file ./myfile.txt http://your-ip:8080/myfile.txt
暂未获取到校验码
该项目暂未在 GitHub Release 页面提供 SHA-256 校验码
SHA256 校验码
暂无校验码
建议从 GitHub Releases 页面直接下载,并自行核对文件完整性
本平台所有 SHA-256 校验码均提取自项目在 GitHub 官方 Release 页面发布的文件,未做任何修改。你可以通过 GitHub Releases 页面自行验证。
开源透明
查看 GitHub 源码卸载说明
若用 Docker,执行 docker rm 删除容器;若用二进制,直接删除下载的可执行文件即可。
无额外依赖
下载后即可直接使用,无需安装其他运行环境
遇到问题?查看下方 FAQ
1 FAQ