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 version | Required form field |
|---|---|
| Default V1 signature | Signature |
| Amazon S3-compatible V2 signature | Signature |
| V2 signature | x-oss-signature |
| V4 signature | x-oss-signature |
| Amazon S3-compatible V4 signature | x-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.
Create a policy encoded in
UTF-8.Encode the policy in
Base64. The result is the value of thepolicyform field and serves as the string-to-sign.Sign the string-to-sign with your
AccessKeySecret:Signature = base64(hmac-sha1(AccessKeySecret, base64(policy)))Write the calculated signature to the correct form field. The following example sets the
Signatureform 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: