0002-00000703

更新时间:
复制 MD 格式

Problem description

The Signature form field is missing from a PostObject request.

Causes

The PostObject request includes a signature, but the signature value is not placed in the correct form field. Each signature version requires a specific form field name.

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

Examples

A PostObject request uses the default V1 signature, but the Signature form field is missing from the request body.

Solutions

Place the calculated signature value in the form field that matches your signature version: Signature, x-oss-signature, or x-amz-signature.

The following steps show how to add the signature for the default V1 signature, which uses the Signature form field.

  1. Create a policy encoded in UTF-8.

  2. Encode the policy in Base64. The Base64-encoded value is both the policy form field value and the string-to-sign.

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

    Signature = base64(hmac-sha1(AccessKeySecret, base64(policy)))
  4. Set the calculated signature as the value of the Signature form field:

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

For the complete PostObject request format, see PostObject.

References

SDK examples for constructing a signed PostObject request: