Sending multipart form data.

0
Hi,   Currently getting some errors when sending data with multipart formdata. 1 parameter is simpy text, the other needs to be the binary part of the file.   When sending I get the following error:   Received fatal alert: record_overflow   I've captured the data that Mendix tries to send, and used it in Postman. Almost send it correctly, only the filename was ommitted in the data that Mendix created.   Then I tried to send the working data from post man. Put it in a the body, added the multi-part header to the request (just link Postman), but then I get the same error. Still... the exact same data was send by Postman correctly. I can not see why Postman works and why it fails in Mendix.   Unfortunately the receiving party can not receive a Base64 encoded string.   Anyone with same problems? And... with a solution?
asked
0 answers
0

This is the text that Mendix creates when I use the form-data option.

 

------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="file"; 
Content-Type: application/pdf

[THE BINARY CONTENT]
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="somefield"

bladiebla
------WebKitFormBoundaryfxchezaSjlWtxBDp--

This fails when I use this in Postman. But, when I add filename="Example.pdf", then it works fine in Postman.

 

------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="file"; filename="Example.pdf"
Content-Type: application/pdf

[THE BINARY CONTENT]
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="somefield"

bladiebla
------WebKitFormBoundaryfxchezaSjlWtxBDp--

 

When I use this in Mendix as the raw body in Mendix (with the correct Content-Type), it will not work and will result in the error as in the original post.

 

So... am I doing something completely wrong or does Mendix(/Java) messes things up?

answered