Rest receive json and a file
Question

Hello Guru's!

I have a question I have a rest service to receive data from a external system.

I want to receive a filename and the file then store the file in a table and in a outsystems screen download the file.

So in the database I store the file in a field with the type binary data.

But what is the best way to receive the name and the file in a rest service?


I was thinking on doing a json body and send the file in base64 format.

Then before storing in in the database I can do a base64 to binary data.


Dear Freek

I have not that much idea about the question but one old discussion may help you out. Please look into the same at: https://www.outsystems.com/forums/discussion/44211/how-to-consume-api-with-input-as-file/ 


Regards

mvp_badge
MVP

Hi Freek,

Am I to understand that you want to build the REST service yourself? Because in that case, you can simply define an Attribute of type Binary, and assign the file content to it. The Platform will convert it to base64 and back, so no need to convert it yourself.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.