Upload a File Data Chunk to an ObjectStore (REST API: POST)

Use this operation to upload a chunk or portion of the file data to the ObjectStore. You can also verify the file integrity of each chunk or the complete file in the last chunk using Secure Hash Algorithm (SHA) - 256 cryptographic hash function. For more information, see File Integrity Check.

Before you run this operation, make sure to initiate the upload session to ObjectStore. For details, see Initiate an Upload Session to ObjectStore.

Request

Syntax

POST <webservice>/contentstore/file/action/upload?uploadType=chunkedFile&requestId={requestId} HTTP/1.1
Host: <host name>
Accept: application/xml
Authtoken: <authentication token>
BlockLevelHash: <SHA hash of the concatenated hash of all the chunks>
<file contents>

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Parameters

Name

Description

Required

requestId

The unique identifier for the current upload session. For details on receiving the requestId, see Initiate an Upload Session to ObjectStore.

Yes

Request Headers

Name

Description

Host

The host name of the Web Server or Web Console used in the API request.

Accept

The format of the response. Valid values are: application/xml or application/json.

Authtoken

The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication.

FileEOF

Specifies whether the end of file has reached with the current file chunk. Allowed values are 0 and 1.

To indicate end of file, enter the value 1.

If end of file has not reached, you can skip this header or enter the value 0.

FullFileHash

(optional) The SHA-256 hash of the complete file.

BlockLevelFileHash

(optional) The SHA-256 hash value of the concatenated hash of all the chunks. Required in the end of file chunk, only if verifyBlockLevelFileHash is set to true in the initiate session for upload.

Request Body

Include the contents of the file chunk in bytes.

Response

Response Parameters

Parameter

Description

Element

chunkOffset

The number of bytes received by the Web Server for the uploaded file chunk.

DM2ContentIndexing_UploadFileResp

fileGUID

The GUID of the complete file. GUID is a unique identifier for a file or folder and remains the same even when you rename or move the file or folder to another path.

The file GUID is displayed when you upload the last file data chunk with fileEOF header value 1.

DM2ContentIndexing_UploadFileResp

fileIntegrityVerified (optional)

Value 1 indicates that the hash value is identical and the file integrity check is verified.

DM2ContentIndexing_UploadFileResp

Examples

Sample Request

POST <webservice>/contentstore/file/action/upload?uploadType=chunkedFile&requestId=378473483748734874343434345656574 HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
FileName: Zmxvd2Vycy50eHQ=
FileSize: 845941
FileModifiedtime: 1424813723
ParentFolderPath: XHBsYW50cw0K
EOF: 1
BlockLevelFileHash: ac4623c63bafc15a4ceb6158b6075d633d8d9e9ad2d18c0dbd5ad4b5d97564b9
<file contents>

Supported Error Codes

Code

Status

Description

400

Bad Request

The request is missing required headers or file content in the request body.

403

Forbidden

Error due to one of the following reasons:

  • The user does not have rights to upload the file.

  • The upload operation is disabled by the administrator by disabling backup activity from the CommCell Console.

  • File Integrity check failed. The hash value in the header did not match with the hash value of the uploaded file.

Loading...