Commiting files Uploads parts requires Sha Digest via API Curl
AnsweredI have successfully uploaded files in parts and and its successful. I can get part id, offsets etc
Now I want to commit the uploaded files parts using the curl API Request below
>
curl -X POST \
https://upload.box.com/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/commit \
-H 'authorization: Bearer ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'digest: sha=DhIcpd61HctMIGTMu7tyY54Da2U=' \
-d '{
"parts":[
{"part_id": "BFDF5379","offset": 0,"size": 8388608},
{"part_id": "E8A3ED8E","offset": 8388608,"size": 1611392}
],
"attributes":{"content_modified_at":"2017-04-08T00:58:08Z"}
}'
>
Here is my question: Which digest is required here again.
Let assume that my files was uploaded in 4 parts. Is it base64 encoded Sha1 digest of each file partsize for the file already uploaded via upload Parts.
Where do I get the Sha1 digest stated in the API above. Again will this Sha1 be base64encode again.
Please I need an explanations. Thanks
-
Hi ,
Great question! The sha1 used for the commit call is the base64 encoded sha1 for the entire file.
If it helps, take a look at this working example from our node.JS SDK:
https://github.com/box/box-node-sdk/blob/master/docs/files.md#commit-upload-session
If that doesn't make sense or if we can clarify anything please feel free to ask!
Thanks,
Jason
Please sign in to leave a comment.
Comments
1 comment