Before you can upload a file, you must generate a token to associate with the upload. To do this, use the startFileUpload
endpoint (PUT /ccadmin
). The request JSON for this endpoint includes three properties:
filename
– The pathname for the file, relative to the/thirdparty
folder. So, for example, if you want to upload a file namedpolicy.html
to be located directly in the/thirdparty
folder, the value of thefilename
property would bepolicy.html
. (Do not include a leading slash;/policy.html
is incorrect.) If you want to upload a file namedpolicy.html
to be located in the/thirdparty/myfolder
subfolder, the value of thefilename
property would bemyfolder/policy.html
. (If the subfolder does not already exist, it is created automatically when the file is uploaded.)segments
-- The file must be uploaded in segments of less than 1 GB each. If your file is larger than 1 GB, it must be up broken up into multiple segments, with each segment uploaded separately. Thesegments
property specifies the number of segments to be uploaded.uploadtype
– Set the value of this property tothirdPartyFile
.
The following request body generates a token for uploading a third-party file named /thirdparty/myfolder/sampleFile.txt
in two segments:
{ "filename": "myfolder/sampleFile.txt", "segments": 2, "uploadtype": "thirdPartyFile" }
The response body includes the token and an array of the indices of the segments to be uploaded. The indices are zero-based, so the first segment is 0:
{ "links": [ { "rel": "self", "href": "http://myserver.example.com:7002/ccadmin/v1/files" } ], "segmentsNeeded": [ 0, 1 ], "token": "18a7878ddf1ab_1751" }