All Products
Search
Document Center

Object Storage Service:Why did I receive the "The Content-MD5 you specified was invalid" error when I uploaded a file to OSS by using STS?

Last Updated:Mar 20, 2026

Problem description

When uploading a file to Object Storage Service (OSS) by using Security Token Service (STS), the InvalidDigest error is returned:

The Content-MD5 you specified was invalid

Causes

If the upload request includes a Content-MD5 header, OSS calculates the MD5 hash of the received object and compares it against the value in the header. If the two values do not match, OSS returns InvalidDigest to protect data integrity.

Solutions

Recalculate the MD5 hash of the object and make sure the value in the Content-MD5 header matches exactly. Then retry the upload.

For details on how to calculate and format the MD5 hash correctly, see Include signatures in the Authorization header or hash.

References

Applicable scope

  • OSS