Create Upload Session
First, create an upload session. The resulting object defines the size of each part and the number of parts to upload.Split File
Split the file into parts to be uploaded. If you want to use the command line, use thesplit command:
Get SHA Digest
To get the value for theSHA digest,
use the following openSSL command
to encode the file part:
Upload Part
Upload the bytes for the part you want to upload, specifying the byte range for the part and theSHA digest to ensure the content is
uploaded correctly.
Content Range
Each part’s size must be exactly equal in size to the part size specified in the upload session that you created. One exception is the last part of the file, as this can be smaller. TheContent-Range parameter
definition follows this pattern:
Content-Range, remember that:
- The lower bound of each part’s byte range must be a multiple of the part size.
- The higher bound must be a multiple of the part size - 1.
8388608,
the content range for the first two parts will be:
Response
After each upload, the resulting response includes theID and SHA of the part uploaded.
Range Overlap
If a part upload request fails with any error coderange_overlaps_existing_part then the application
made a mistake in cutting up the file into parts
and tried to upload a part into a range that already had
content uploaded for it. The application should assume
that this last part was not persisted to the session.
