0002-00000705

Updated at:

Problem description

The signature in the PostObject request does not match the signature calculated by Object Storage Service (OSS).

Causes

You initiated a PostObject request that includes a signature, but the signature in the PostObject request does not match the signature calculated by OSS. The following scenarios may occur:

  • If the default V1 signature or the Amazon S3-compatible V2 signature is included in the PostObject request, the signature must be specified in the Signature form field.

  • If the V2 or V4 signature is included in the PostObject request, the signature must be specified in the x-oss-signature form field.

  • If the Amazon S3-compatible V4 signature is included in the PostObject request, the signature must be specified in the x-amz-signature form field.

Examples

You initiated a PostObject request that includes a default V1 signature, but the value of the Signature form field is invalid.

Solutions

To add a calculated signature to the form field, perform the following steps:

  1. Create a policy that is encoded in UTF-8.

  2. Encode the policy in Base64. The encoding result is the value of the policy form field, and this value is used as the string-to-sign.

  3. Use AccessKeySecret to sign the string-to-sign.

    Signature = base64(hmac-sha1(AccessKeySecret, base64(policy)))
  4. The following sample code provides an example on how to specify the calculated signature in the Signature form field.

    Content-Disposition: form-data; name="Signature"
    {signature}
    --9431149156168

For more information, see PostObject.

References

You can also refer to the following topics to initiate a PostObject request that includes the signature: