Hey guys,
did you change anything on the File REST API recently? Or do you have any issues with the API/servers?
Getting only “Corrupted multipart request. File content is absent in request body” error messages when I try to upload something to the File API.
The code worked definitely some time ago. Since then the code was not touched and the version is used by some customers.
The client application is a C++ Qt application. Hope this code sniplet helps, since this is only a small fraction, but the part which is responsible for the REST API access and upload of the file.
I have checked our release history, there is nothing has been changed in Files API for a long time.
Also I have checked this endpoint using REST API and it works fine for me. Don’t know what’s going wrong here. Can you verify that you making correct request? Any chance that some library of whatever you’re using for request has been updated and broke this functionality? You can also test this endpoint using Postman or another tool.
When I try to upload something with Postman I get the same error.
This is my command which Postman generates:
curl -X POST https://api.backendless.com/63087FF7-7E1D-973D-FF3B-D5F0740FA100/5C363F28-6536-9660-FFAF-xxxxxxxxx/files/test/test.txt
-H ‘Content-Type: multipart/form-data’
-H ‘Postman-Token: c816d9f0-b4d3-4266-ae93-5f3ce2750da5’
-H ‘cache-control: no-cache’
-H ‘content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW’
-H ‘user-token: E5626D8D-1A67-B5FA-FF53-xxxxxxxxx’
-F test.txt=ContentThatDoesNotMakeSense
I get this error:
{
“code”: 6011,
“message”: “Corrupted multipart request. File content is absent in request body”,
“errorData”: {}
}
This is what the HTTP request from Postman looks like
Ok, I’ve reproduced this issue. It happens only when the file content is empty.
I’ve created an internal ticket to fix this issue. We will keep you informed here.
Thanks for reporting this!
Sorry for the late reply. I fixed it on that day. Found out, that the filename attribute in the content header must not be empty. Until a week (or a few days more) this was definetly possible. Might this be a change in one of the libs you are using? Our application worked like this for more than a year.