Help Center/ KooDrive/ API Reference/ API/ File Management/ Obtains the upload link.
Updated on 2025-08-28 GMT+08:00

Obtains the upload link.

Function

Generate the upload link of a file part for multipart upload.

URI

POST /koodrive/ose/v1/files/multipart/uploadUrl

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permissions. When an API is called, the token is added to the request header to obtain the operation permissions. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

language

No

String

Language code, which complies with the internationalization specifications. For example, en-US indicates English (United States). English (United States) is used by default.

X-Traceid

No

String

Message log trace ID. The value contains 58 bits.

X-User-Id

Yes

String

User ID, which is used for app authentication.

X-Date

Yes

String

Date, which is used for app authentication.

Host

Yes

String

Address, which is used for app authentication.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

fileId

Yes

String

File ID.

multiParts

Yes

Array of MultiPartInfo objects

Part information list.

Table 3 MultiPartInfo

Parameter

Mandatory

Type

Description

partNumber

Yes

Integer

Part No.

partSize

Yes

Long

Part length. The value range is [5,242,880, 5,368,709,120]. The value range of the last part is [0, 5,368,709,120].

Minimum value: 0.

Maximum value: 5,368,709,120.

partOffset

No

Long

Total length (in bytes) to the last data block. This parameter is valid only during concurrent multipart upload. The size of all parts except the last one must be a multiple of 64 bytes.

hashCtx

No

Array of longs

Context used to iteratively calculate SHA256. This field is valid only during concurrent multipart upload. For SHA1, the value is the first to fifth 32-bit variables of the SHA1 of the previous data block. For SHA256, the value is the first to eighth 32-bit variables of the SHA256 of the previous data block.

This parameter is mandatory for all parts except the first one in concurrent multipart upload.

uploadUrl

No

String

URL for uploading a file, which is a return parameter. The PUT method is required for uploading a file.

partId

No

String

Part object ID.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

multiParts

Array of MultiPartInfo objects

Multipart information.

code

Integer

Response code.

msg

String

Response message.

Table 5 MultiPartInfo

Parameter

Type

Description

partNumber

Integer

Part No.

partSize

Long

Part length. The value range is [5,242,880, 5,368,709,120]. The value range of the last part is [0, 5,368,709,120].

Minimum value: 0.

Maximum value: 5,368,709,120.

partOffset

Long

Total length (in bytes) to the last data block. This parameter is valid only during concurrent multipart upload. The size of all parts except the last one must be a multiple of 64 bytes.

hashCtx

Array of longs

Context used to iteratively calculate SHA256. This field is valid only during concurrent multipart upload. For SHA1, the value is the first to fifth 32-bit variables of the SHA1 of the previous data block. For SHA256, the value is the first to eighth 32-bit variables of the SHA256 of the previous data block.

This parameter is mandatory for all parts except the first one in concurrent multipart upload.

uploadUrl

String

URL for uploading a file, which is a return parameter. The PUT method is required for uploading a file.

partId

String

Part object ID.

Example Requests

Creates file metadata in multipart upload mode. In this example, a file is divided into 46 to 50 parts. The upload link of the part is returned in the subsequent response. The part needs to be uploaded through a PUT request.

POST /koodrive/ose/v1/files/multipart/uploadUrl

Authorization:Bearer+10f88*********4791e9ff
{
	"fileId": "Fqo2kYHmsgWg5whxzYHZLL7mebXbBr1no",
	"multiParts": [
		{
			"hashCtx": [
				1748048713,
				2644528514,
				4267727253,
				2252747490,
				4036182088,
				2253856463,
				526139147,
				2194267752
			],
			"partNumber": 46,
			"partOffset": 471859200,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				1606212,
				1743131457,
				2392241618,
				605997363,
				3054356113,
				673008609,
				3509469858,
				2186398707
			],
			"partNumber": 47,
			"partOffset": 482344960,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				3734586607,
				1407828785,
				3243195625,
				3451635323,
				4031416500,
				3005674269,
				2829389145,
				3478923465
			],
			"partNumber": 48,
			"partOffset": 492830720,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				3677016828,
				906610338,
				3389225168,
				2507561547,
				1134075905,
				3951513567,
				1673174790,
				3034719756
			],
			"partNumber": 49,
			"partOffset": 503316480,
			"partSize": 10485760
		},
		{
			"hashCtx": [
				1827691250,
				2956926651,
				1801460777,
				4119662276,
				4162375117,
				187866976,
				1789369655,
				278284511
			],
			"partNumber": 50,
			"partOffset": 513802240,
			"partSize": 10485760
		}
	]
}

Example Responses

Status code: 200

Upload information of the corresponding part.

{
  "multiParts" : [ {
    "partNumber" : 46,
    "partSize" : 10485760,
    "partOffset" : 471859200,
    "hashCtx" : [ 1748048713, 2644528514, 4267727253, 2252747490, 4036182088, 2253856463, 526139147, 2194267752 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=46&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxNzQ4MDQ4NzEzLDI2NDQ1Mjg1MTQsNDI2NzcyNzI1MywyMjUyNzQ3NDkwLDQwMzYxODIwODgsMjI1Mzg1NjQ2Myw1MjYxMzkxNDcsMjE5NDI2Nzc1Ml0sIm5oIjowLCJubCI6Mzc3NDg3MzYwMCwiaGFzaF90eXBlIjoic2hhMjU2In0%3D&X-Amz-Signature=d3e7f60f45c8fd3960e697c57bb7d1c386dd20940b860fd976ba77425767d65e"
  }, {
    "partNumber" : 47,
    "partSize" : 10485760,
    "partOffset" : 482344960,
    "hashCtx" : [ 1606212, 1743131457, 2392241618, 605997363, 3054356113, 673008609, 3509469858, 2186398707 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=47&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxNjA2MjEyLDE3NDMxMzE0NTcsMjM5MjI0MTYxOCw2MDU5OTczNjMsMzA1NDM1NjExMyw2NzMwMDg2MDksMzUwOTQ2OTg1OCwyMTg2Mzk4NzA3XSwibmgiOjAsIm5sIjozODU4NzU5NjgwLCJoYXNoX3R5cGUiOiJzaGEyNTYifQ%3D%3D&X-Amz-Signature=38980d3be00e528ee11c366ae69e950d673528203f3869a26f39dae42b4dabbb"
  }, {
    "partNumber" : 48,
    "partSize" : 10485760,
    "partOffset" : 492830720,
    "hashCtx" : [ 3734586607, 1407828785, 3243195625, 3451635323, 4031416500, 3005674269, 2829389145, 3478923465 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=48&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlszNzM0NTg2NjA3LDE0MDc4Mjg3ODUsMzI0MzE5NTYyNSwzNDUxNjM1MzIzLDQwMzE0MTY1MDAsMzAwNTY3NDI2OSwyODI5Mzg5MTQ1LDM0Nzg5MjM0NjVdLCJuaCI6MCwibmwiOjM5NDI2NDU3NjAsImhhc2hfdHlwZSI6InNoYTI1NiJ9&X-Amz-Signature=d5608f38d6afdfee117be1243870b63f46ff11676633e0630d122f0c4145e8ae"
  }, {
    "partNumber" : 49,
    "partSize" : 10485760,
    "partOffset" : 503316480,
    "hashCtx" : [ 3677016828, 906610338, 3389225168, 2507561547, 1134075905, 3951513567, 1673174790, 3034719756 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=49&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlszNjc3MDE2ODI4LDkwNjYxMDMzOCwzMzg5MjI1MTY4LDI1MDc1NjE1NDcsMTEzNDA3NTkwNSwzOTUxNTEzNTY3LDE2NzMxNzQ3OTAsMzAzNDcxOTc1Nl0sIm5oIjowLCJubCI6NDAyNjUzMTg0MCwiaGFzaF90eXBlIjoic2hhMjU2In0%3D&X-Amz-Signature=52eb71278fc9310f13a5b92641b5a726d0006be8dd89a242f9c4ce09c360e1f7"
  }, {
    "partNumber" : 50,
    "partSize" : 10485760,
    "partOffset" : 513802240,
    "hashCtx" : [ 1827691250, 2956926651, 1801460777, 4119662276, 4162375117, 187866976, 1789369655, 278284511 ],
    "uploadUrl" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/4e8108ee15fa471cbe5f18f03e8b555b086?partNumber=50&uploadId=0000019039E1E8520006EBE63B492EDB&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240621T082041Z&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20240621%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Iteration-Hash-Ctx=eyJtZF9sZW4iOjMyLCJudW0iOjAsImgiOlsxODI3NjkxMjUwLDI5NTY5MjY2NTEsMTgwMTQ2MDc3Nyw0MTE5NjYyMjc2LDQxNjIzNzUxMTcsMTg3ODY2OTc2LDE3ODkzNjk2NTUsMjc4Mjg0NTExXSwibmgiOjAsIm5sIjo0MTEwNDE3OTIwLCJoYXNoX3R5cGUiOiJzaGEyNTYifQ%3D%3D&X-Amz-Signature=154bcd4ad7774f20e196666d403bf3d4359dd151b9cb1cc1f604c6517c4a287b"
  } ],
  "code" : 0,
  "msg" : "Success."
}

Status Codes

Status Code

Description

200

Upload information of the corresponding part.