I have an HTTP-in node that receives a request containing the following payload:
------WebKitFormBoundaryk5AazdSJAKEDRWS9
Content-Disposition: form-data; name="file"; filename="Sample1.csv"
Content-Type: application/vnd.ms-excel
< ... csv data here ... >
------WebKitFormBoundaryk5AazdSJAKEDRWS9
Content-Disposition: form-data; name="data"; filename="Sample1.json"
Content-Type: application/json
< ... json data here ... >
------WebKitFormBoundaryk5AazdSJAKEDRWS9--
How do I extract/parse the data or file content?
Sadly, I am unable to add libraries like formidable
to Node-RED due to lack of access rights.
Update:
It seems to be possible to manually create a multipart/form-data in a function node. So, I ended up using sir @hardillb's answer and recreated the multipart/form-data request in the flow.