0002-00000704

更新时间:
复制 MD 格式

Problem description

The Signature form field in a PostObject request is left blank.

Causes

When you send a PostObject request with a signature, OSS reads the signature value from the corresponding form field to re-create and verify the signature. If the field is blank, the verification fails.

The required form field depends on the signature version:

Signature versionRequired form field
Default V1 signatureSignature
Amazon S3-compatible V2 signatureSignature
V2 signaturex-oss-signature
V4 signaturex-oss-signature
Amazon S3-compatible V4 signaturex-amz-signature

Examples

You send a PostObject request using the default V1 signature, but the Signature form field is missing from the request.

Solutions

Calculate the signature and write it to the correct form field (Signature, x-oss-signature, or x-amz-signature) based on your signature version.

  1. Create a policy encoded in UTF-8.

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

  3. Sign the string-to-sign with your AccessKeySecret:

    Signature = base64(hmac-sha1(AccessKeySecret, base64(policy)))
  4. Write the calculated signature to the correct form field. The following example sets the Signature form field:

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

For complete parameter details, see PostObject.

References

To see complete PostObject request examples with signatures, refer to the following SDK samples: