基于 API Key 上传、公开 URL 访问、定时自动清理的轻量图片存储服务。
| 公开访问前缀 | /i/<YYYY-MM>/<文件名> |
|---|---|
| 单文件上限 | 10.00 MB |
| 允许类型 | image/jpeg, image/png, image/gif, image/webp, image/avif, image/svg+xml |
| 文件保留 | 30 天 |
| 定时清理 | 0 3 * * * |
| 总量上限 | 不限 |
需要请求头 X-API-Key,表单字段名 file,使用 multipart/form-data。
curl -X POST ${BASE}/api/upload \
-H "X-API-Key: YOUR_KEY" \
-F "file=@/path/to/image.png"
成功返回:
{
"success": true,
"url": "https://your-host/i/2026-07/xxxxxxxx.png",
"size": 204800,
"mimetype": "image/png"
}
GET /health | 健康检查 |
|---|---|
GET /api/stats | 存储统计(需鉴权) |
POST /api/cleanup | 手动触发清理(需鉴权) |