XAmzContentSHA256Mismatch when trying to upload image via the Spaces API

Posted September 18, 2017 4.9k views


I am getting XAmzContentSHA256Mismatch when trying to upload an image via the Spaces API.

Uploading a text/plain works fine, but I am really struggling with image/png.

Using postman, and adding the image in the body as form-data.

Sha256 generated with digest.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers

I’ve found that DigitalOcean Spaces does not like signed payloads, which is the default when using things like the AWS PHP SDK v3.

So as well as setting “endpoint”, also set “signature_version” to “v4-unsigned-body”.

Did you ever find out a fix for this, I am having the same problem.

I’m having the same problem

I have a similar problem using, since it states The provided 'x-amz-content-sha256' header does not match what was computed, it seems that the API is not 100% compatible with S3 API.