Skip to content

Confirm Upload Completion

Request

Confirm an uploaded Cloud Storage file.

  • Preconditions: the file record must belong to your team and the object must already be in storage — the service reads its ETag and length to verify. Size must be greater than 0 and under 2 GB.
  • Effect: charges the team's storage quota atomically, then marks the record uploaded and stores the real size. Until this succeeds the file does not appear in /cloudstorage/file/page and keeps occupying one of the 100 pending slots.
  • On failure the uploaded object is deleted. Calling this too early, over the size limit, or with no space left removes the bytes from storage and leaves the record unconfirmed. Recovery is a fresh /cloudstorage/upload/init and a re-upload, not a retry of this call.
  • Completion: synchronous and idempotent once it has succeeded — a second call returns the same file without charging quota again.
  • Note: a record that is never confirmed is cleaned up automatically after 24 hours.

Documented business errors: 39001, 39011, 39014, 39041, 39046, 39047. See Error Codes for what each code means. Any operation can additionally return the common codes.

Bodyapplication/jsonrequired
idstringrequired

Cloud storage file ID returned by the presigned upload URL API.

Example:"1800000000000001"
POST
/api/cloudstorage/upload/complete
curl -i -X POST \
  http://127.0.0.1:40000/api/cloudstorage/upload/complete \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "1800000000000001"
  }'

Responses

Success

Bodyapplication/json
codeintegerrequired

Return result code. 0 means success; other codes indicate exceptions.

Example:0
msgstring or nullrequired

Error message.

Example:null
requestIdstring

Operation request ID. This field may be present when the request passes through the API gateway.

Example:"1d4f3ea968664593860b94b35d4ebf5e"
dataobject(CloudStorageFile)required
Response
{ "code": 0, "msg": null, "requestId": "1d4f3ea968664593860b94b35d4ebf5e", "data": { "id": "1800000000001001", "fileName": "example", "fileExt": "jpg", "fileSize": "204800", "fileType": 0, "tagInfo": [], "createDate": "string", "updateDate": "string" } }