> ## 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` |
