> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alforse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 文件

> 上传和下载合同原件、发票、收款凭证和其他证据文件。

文件上传采用 presign、对象存储直传、confirm 三步流程；API 不直接接收原始文件体。

| 端点                        | 请求体/参数                                                                     | 权限                   |
| ------------------------- | -------------------------------------------------------------------------- | -------------------- |
| `POST /files/presign`     | `fileName, contentType, sizeBytes, kind, subjectId, contractId, paymentId` | `contract_view view` |
| `PUT signed upload URL`   | `file bytes to object storage`                                             | `signed URL`         |
| `POST /files/confirm`     | `objectKey, fileName, contentType, sizeBytes, kind, uploadToken`           | `contract_view view` |
| `GET /files/:id/download` | `contractId, paymentId`                                                    | `contract_view view` |
