How to receive a PDF file via a Mendix POST API?

0
I am trying to make it so one of our separate applications can make a POST call to Mendix, sending a PDF file with it, this file would then be stored in the Mendix database, and retrieved and rendered in the Universal File Viewer widget (found in the marketplace) when the user opens a specific page. However, no matter what I try, I cannot seem to send the file over to Mendix. I either get a “bad request” error, or it sends a pretty much empty object with no name, content, or size (see below). I have tried sending the file as binary using an import mapping, as well as form data (see below), but nothing seems to work. Any help would be greatly appreciated.
asked
1 answers
0

Try base64 encoding the file first. This way it is a string that you can just decode again to make it a file again. In the community commons you have the actions to base64 encode or decode a file. This way it is far easier to handle binaries in REST calls.

Regards,

Ronald

 

answered