Problem description
The value length of the callback-var
field exceeds the upper limit.
Causes
You initiated a request and the value length of the callback-var
field that specifies upload callback exceeds the upper limit. As a result, the error is reported. The length requirement applies to the callback-var parameter in URL-based requests, the x-oss-callback-var field in request headers, and the form field named callback-var in Post requests. The value of the callback-var field must be a JSON string that is encoded in the Base64 format, and cannot exceed 5 KB in length. Otherwise, the error is returned.
Examples
The following code shows a sample request in which the value of the callback-var field exceeds 5 KB in length:
PUT /test.txt HTTP/1.1
Host: callback-test.oss-cn-hanghzou.aliyuncs.com
Content-Length: 4
x-oss-callback-var: eyJ4Om15X3ZhciI...(10,000 characters here)...jYWxsYmFjay10ZXN****=
x-oss-callback: eyJjYWxsYm15X3Zh******ciFja1Vyb0=
Date: Sun, 19 Feb 2023 09:42:14 GMT
Content-Type: text/plain
Authorization: OSS qn6q**************:77Dv****************
Test
In the preceding request, the value of the x-oss-callback-var field exceeds 5 KB in length. As a result, the error is returned.
Solutions
Make sure that the value of the callback-var field meets the length requirement.
References
For information about the principles of the upload callback feature and how to use the feature, see Upload callback and Callback.
For information about the common errors that you may encounter when you configure upload callback and the causes of the errors, see Upload callback errors and troubleshooting.
For information about how to obtain signature information from the server in various programming languages based on POST policies, configure upload callback, and then directly upload data to OSS by using form upload, see Overview.
For information about how to set up an OSS-based direct data transfer service for mobile apps and configure upload callback, see Set up upload callback for mobile apps.