Skip to content

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
POST

Content-Type:

text
multipart/form-data

Body Parameters:

ParameterTypeRequiredDescription
tokenstringYesReturned by the Pre-upload File Chunks interface
md5stringYesFile MD5 value
partNumberintegerYesChunk index
filefileYesChunk file stream
totalChunksintegerYesTotal number of chunks
fileSuffixstringYesFile suffix (including dot, e.g., .jpg)
totalSizeintegerYesTotal file size
fileNamestringYesFile name

Note: This API uses multipart/form-data format.

Request Example:

text
token: <returned by the pre-upload interface>
md5: 2fd07ca9481fa8507b18b43612648cc5
partNumber: 1
file: <binary>
totalChunks: 1
fileSuffix: .png
totalSize: 1024
fileName: 2

Response Parameters:

ParameterTypeDescription
codeintegerError code. See Error Codes
dataobjectResponse data
├─ statusintegerWhether the file upload is complete (0: incomplete, 1: complete)
├─ md5stringFile MD5
├─ partNumberintegerCurrent chunk number
├─ uploadedChunksarray[string]List of uploaded chunks
├─ totalChunksintegerTotal number of chunks
├─ urlstringFile URL, returned only when upload is complete
├─ appSidstring-
msgstringError message, user-readable

Response Example:

json
{
    "code": 0,
    "data": {
        "status": 0,
        "md5": "",
        "partNumber": 0,
        "uploadedChunks": [""],
        "totalChunks": 0,
        "url": "",
        "appSid": ""
    },
    "msg": ""
}

OpenAPI Docs