下载文件
GET
/web/v1/files/query/{fileBizId}/downloadJWT + Turnstile以流式二进制响应直接下载文件。响应包含相应的 Content-Disposition、Content-Type 和 Content-Length 请求头。
鉴权
Auth Chain: WEB Chain — 需要
Authorization: Bearer <jwt>和 Turnstile token。 以下请求头由系统自动注入(前端无需处理):X-PORTAL-ACCESS-CODE(Nginx),X-Request-Id(Gateway)
请求参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
fileBizId | string | Yes | path | 文件业务 ID |
成功响应
响应为二进制文件流,包含以下请求头:
| Header | Example Value |
|---|---|
Content-Disposition | attachment; filename="invoice.pdf" |
Content-Type | application/pdf |
Content-Length | 102400 |
错误响应
Unauthorized401
{
"success": false,
"code": "4010",
"message": "Invalid or expired token"
}Not Found404
{
"success": false,
"code": "4040",
"message": "File not found"
}说明
- 响应体为原始二进制流,非 JSON 格式。
- 对于大文件,建议使用获取下载 URL接口,将下载操作转移至对象存储直接处理。
- 原始文件名保留在
Content-Disposition请求头中。