Skip to main content

I'm pretty sure the Digest is calculated correctly but the API keeps telling me invalid digest. Could you please help?


hieunguyen@hieunguyen ChunkedUpload % shasum partaa
c045fe3b4c9e002aa8fbc617961d8490ca887da1 partaa
hieunguyen@hieunguyen ChunkedUpload % echo -n c045fe3b4c9e002aa8fbc617961d8490ca887da1 | base64
YzA0NWZlM2I0YzllMDAyYWE4ZmJjNjE3OTYxZDg0OTBjYTg4N2RhMQ==


Request


curl --location --request PUT 'https://upload.box.com/api/2.0/files/upload_sessions/9379B6066E6923FD7FCB5FC982C51D06' \
--header 'digest: sha=YzA0NWZlM2I0YzllMDAyYWE4ZmJjNjE3OTYxZDg0OTBjYTg4N2RhMQ==' \
--header 'content-range: bytes 0-8388607/105255200' \
--header 'Content-Type: application/octet-stream' \
--header 'Authorization: Bearer something' \
--data-binary '@/Users/hieunguyen/Downloads/ChunkedUpload/partaa'

Response


{
"code": "invalid_digest",
"message": "Digest header invalid: sha=YzA0NWZlM2I0YzllMDAyYWE4ZmJjNjE3OTYxZDg0OTBjYTg4N2RhMQ==",
"request_id": "28d371294088d4507bca4d389b2e1df3"
}

In my opinion, your sha :


YzA0NWZlM2I0YzllMDAyYWE4ZmJjNjE3OTYxZDg0OTBjYTg4N2RhMQ=

 is an SHA-256 base64 encoded and not an SHA-1 base64 encoded.


Reply