# 上传静态资源 (/docs/api/compatible/cloudflare/uploadAssets)



`POST /cloudflare/client/v4/accounts/{account_id}/workers/assets/upload`

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

**支持状态: partial**

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

## 参数 [#参数]

| 名称          | 位置    | 类型      | 必填    | 说明                                              |
| ----------- | ----- | ------- | ----- | ----------------------------------------------- |
| account\_id | path  | string  | true  | Any value; your account comes from the API key. |
| base64      | query | boolean | false | Field values are base64.                        |

## 请求体 (multipart/form-data) [#请求体-multipartform-data]

必填: true

| 名称 | 类型 | 说明 |
| -- | -- | -- |

```json
{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  },
  "description": "One form field per file: the field name is the hash, the value the content."
}
```

## 响应 [#响应]

### HTTP 201 [#http-201]

Success

**application/json**

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| success | boolean | Always true on success. |
| errors | array&lt;any&gt; | Always empty on success. |
| messages | array&lt;any&gt; | Always empty on success. |
| result | object |  |
| result.jwt | string &#124; null | Completion token after the last batch; null for earlier batches. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |

### HTTP 202 [#http-202]

Batch stored; more batches remain (no completion token yet).

**application/json**

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| success | boolean | Always true on success. |
| errors | array&lt;any&gt; | Always empty on success. |
| messages | array&lt;any&gt; | Always empty on success. |
| result | object |  |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
