Upload File to System
Upload file chunks to the system. Supports large file chunked uploads. Upload one chunk at a time, and the system automatically merges them into a complete file after all chunks are uploaded.
Interface Address:
Returned by the Pre-upload File Chunks interface (uploadUrl field in the response).
Request Method:
text
POSTContent-Type:
text
multipart/form-dataBody Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| token | string | Yes | Returned by the Pre-upload File Chunks interface |
| md5 | string | Yes | File MD5 value |
| partNumber | integer | Yes | Chunk index |
| file | file | Yes | Chunk file stream |
| totalChunks | integer | Yes | Total number of chunks |
| fileSuffix | string | Yes | File suffix (including dot, e.g., .jpg) |
| totalSize | integer | Yes | Total file size |
| fileName | string | Yes | File name |
Note: This API uses
multipart/form-dataformat.
Request Example:
text
token: <returned by the pre-upload interface>
md5: 2fd07ca9481fa8507b18b43612648cc5
partNumber: 1
file: <binary>
totalChunks: 1
fileSuffix: .png
totalSize: 1024
fileName: 2Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| code | integer | Error code. See Error Codes |
| data | object | Response data |
| ├─ status | integer | Whether the file upload is complete (0: incomplete, 1: complete) |
| ├─ md5 | string | File MD5 |
| ├─ partNumber | integer | Current chunk number |
| ├─ uploadedChunks | array[string] | List of uploaded chunks |
| ├─ totalChunks | integer | Total number of chunks |
| ├─ url | string | File URL, returned only when upload is complete |
| ├─ appSid | string | - |
| msg | string | Error message, user-readable |
Response Example:
json
{
"code": 0,
"data": {
"status": 0,
"md5": "",
"partNumber": 0,
"uploadedChunks": [""],
"totalChunks": 0,
"url": "",
"appSid": ""
},
"msg": ""
}