Upload File Part
/essbase/rest/v1/files/upload-part/{path}
Upload part of a file in a multipart file upload. You must have already initiated a multipart file upload. Provide the upload path, a part number (integer), and the unique upload ID that was returned from the Create Multipart File Upload operation.
Note: If multiple object parts are uploaded using the same upload ID and part number, the latest upload overwrites the previous.
Request
- application/octet-stream
-
path(required): string
Pattern:
.+
Catalog path of the folder to which you want to upload the file.
-
partNum(required): integer(int32)
Part number for partial file upload.
-
uploadId(required): string
Upload ID of partial file upload initiation.
Response
- application/json
- application/xml
200 Response
OK
Returns a unique ETag (entity tag). Both the part number and corresponding ETag value for each part when commit the uploaded.
400 Response
Bad Request
If any issue while uploading parts, it returns error and all parts get clean.
500 Response
Internal Server Error.
Examples
The following example shows how to upload part of a file in a multi-part file upload to the Essbase file catalog. This example uploads two parts. As input, path parameters require the destination catalog path. Query parameters require a part number and an upload ID. As a response, Essbase returns an etag for each part. You need to pass in the etag(s) with their corresponding part numbers when you commit the upload.
This operation is the second step in the multi-part file upload process. The flow of operations is as follows:
-
Create Multipart File Upload
-
Upload File Part (shown in this example)
-
Commit Multipart File Upload (shown in this example)
At any point after the initialization step, you can terminate the process using Abort Multipart File Upload.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat
.
Script with cURL Commands
call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/files/upload-part/users/admin/datafile.txt?partNum=1&uploadId=8399f4a4-6e8f-42d7-b454-b7c0ef8f56f6" -H "Accept:application/json" -H "Content-Type:application/octet-stream" -u %User%:%Password%
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/files/upload-part/users/admin/datafile.txt?partNum=2&uploadId=8399f4a4-6e8f-42d7-b454-b7c0ef8f56f6" -H "Accept:application/json" -H "Content-Type:application/octet-stream" -u %User%:%Password%
Example of Response Bodies
Response 1
{
"partNum" : 1,
"response" : {
"etag" : "c7bb3d4f4589824cea53d27fabfc044"
}
}
Response 2
{
"partNum" : 2,
"response" : {
"etag" : "fa5873784f4df9e5e623e8b716bf2ac7"
}
}