Publish multiple Files in REST and import data back into Mendix

0
Hello everyone,   I have the following usecase:   In my app, I have some data from applicants together with files that they have uploaded. My colleague wrote an app (not in Mendix) which uses AI to check the uploaded PDF Scans and extract information that I want to import into my app to decide whether the applicant is qualified or not.   Now we are looking for the best way to export the PDF documents from my app to his app. My idea was to publish a REST service to provide the documents. But when I try to do this I just get a long string as answer.         How can I fix it or do you have a better idea to give him access to my documents?   Thank you!
asked
3 answers
3

Hi Andre,

You can send file through REST as base64 encoded file(which I think this content is already) and on the other side you can decode this.

Or you can pass the file as form data and pass both file name as string and file object separately as parameters in PRS service. 

 

answered
0

Isn't this a Base64 encoding of your fiile? The receiving end could just decode it to get the actual file.

answered
0

I believe that the value of the Contents attribute is just the PDF file Base64 encoded into a string. Your colleague will just need to Base64 decode the contents of this attribute to get the binary file. This is a common standard so it should be easy to do.

I hope this helps.


 

answered