Problem description
PostObject requests fail when the total size of form field values placed before the file field in the request body exceeds 8 MB.
Causes
If the combined size of all form field values placed before the file field in the request body exceeds 8 MB, OSS rejects the request with an error.
Examples
The following request includes five pre-file fields (filed1–filed5), each carrying 2 MB of data — 10 MB total, which exceeds the 8 MB limit.
POST / HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 6443500495
Date: Sat, 18 Feb 2023 05:17:02 GMT
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryW0DET1iaBMeAOBg3
Host: example-bucket.oss-cn-hangzhou.aliyuncs.com
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="filed1"
xxx...(Characters that are 2 MB in size are omitted here.)...xxx
Content-Disposition: form-data; name="filed2"
xxx...(Characters that are 2 MB in size are omitted here.)...xxx
Content-Disposition: form-data; name="filed3"
xxx...(Characters that are 2 MB in size are omitted here.)...xxx
Content-Disposition: form-data; name="filed4"
xxx...(Characters that are 2 MB in size are omitted here.)...xxx
Content-Disposition: form-data; name="filed5"
xxx...(Characters that are 2 MB in size are omitted here.)...xxx
Content-Disposition: form-data; name="name"
big.img
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="key"
${filename}
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="policy"
eyJleHBpcmF0aW9uIjoiMjAyMy0wMi0xOFQxMzoxOTowMC4wMDBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="OSSAccessKeyId"
LTAI****************
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="success_action_status"
200
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="signature"
miAoLVohS5*****WEXyC3wVecaQ=
------WebKitFormBoundaryW0DET1iaBMeAOBg3
Content-Disposition: form-data; name="file"; filename="big1.img"
Content-Type: application/octet-streamSolutions
Keep the total size of all form field values placed before the file field under 8 MB.
References
PostObject — API reference for the PostObject operation
Add signatures on the client by using JavaScript and upload data to OSS — how to transfer data from a web client to OSS using form upload
PostObject error troubleshooting — common errors and fixes for the PostObject operation