Following is an example of the entire multipart object uploading POST process, using CURL (with line breaks for ease of reading).
...
Info |
---|
Info
|
Start the upload with a 0-byte POST. Set the encoding (
&encoding=2:1
) if there is no default encoding or you need a non-default setting:Initiate the upload
Code Block language bash curl -i "${cluster}/ ?uploads" -XPOST
In the response, locate the headers for the UploadID and the Content-UUID, which is the new object being created:
Returned headers
Code Block language text Castor-System-UploadID: c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P Content-UUID: c88fe8a5daf98f7ce84dc4947238f5c1
Write the first part using the UploadID and Content-UUID and partNumber=1:
Upload the first part
Code Block language bash curl -i "${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1 ?partNumber=1 &uploadid=c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P" -XPOST --data-binary "part 1 data"
Use the Content-UUID returned by this post in the manifest to complete the upload.
Start the second part using the UploadID and Content-UUID and partNumber=2:
Upload the second part
Code Block language bash curl -i "${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1 ?partNumber=2 &uploadid=c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P" -XPOST --data-binary "part 2 data"
Use the Content-UUID returned by this post in the manifest to complete the upload.
Complete the upload with the UploadID and a part manifest:
...