Problem description
The Callback parameter value cannot be Base64-decoded on the server side.
Causes
The Callback parameter value must be a JSON string encoded in Base64. This requirement applies to all three locations where the parameter can appear:
| Location | Parameter | Required format |
|---|---|---|
| URL query string | Callback | Base64-encoded JSON string |
| Request header | x-oss-callback | Base64-encoded JSON string |
| POST form field | callback | Base64-encoded JSON string |
If the server cannot Base64-decode the value in any of these locations, OSS returns the error.
Examples
The following request triggers the error because x-oss-callback is set to x123-*&, which is not a valid Base64-encoded JSON string:
PUT /test.txt HTTP/1.1
Host: callback-test.oss-cn-hanghzou.aliyuncs.com
Content-Length: 4
x-oss-callback-var: eyJ4Om15X3ZhciI6ImZvci1jYWxsYmFjay10ZXN****=
x-oss-callback: x123-*&
Date: Sun, 19 Feb 2023 09:42:14 GMT
Content-Type: text/plain
Authorization: OSS qn6q**************:77Dv****************
TestSolutions
Set the Callback parameter to a valid Base64-encoded JSON string. For the required JSON structure and how to construct the value, see Callback.
References
For how upload callback works and how to use it, see Upload callbacks and Callback.
For common upload callback errors and their causes, see Upload callback errors and troubleshooting.
For how to obtain signature information from a server, configure upload callback, and upload directly to OSS using form upload with a POST policy, see Overview.
For how to set up direct data transfer and upload callback for mobile apps, see Set up upload callbacks for mobile apps.