Http in POST with file attachement

Hello everyone,

i'm trying to define a flow with "http in"-node in POST-mode.

Idea is to upload a xml-file via http-POST from a different machine to node red. In node-red i want to use this file.

I've already configured the http-in with file upload and the http-request-node (200). With debug-node i can see the raw xml.
But how can i use this raw data to translate it to json for example? Everyhing else within this http-in msg is not important to me i just need the data and the file-name.

Thanks and all the best,
Bond

take a look at the cookbook - https://cookbook.nodered.org/basic/convert-xml

Hello @zenofmud ,

thanks for your fast reply.
My problem was that the file-data was in a buffer, not in an (utf8)-string.

I now configured a function-node like this:

msg.payload = msg.req.files[0].buffer.toString('utf8');
return msg;

And now the new string-message was not a problem anymore for the xml-node.

Thanks
Bond

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.