What kind of best way to send a image file to Node-RED

Hello there,

I want to save a image file from device to DB with Node-RED.
So i create flows as below inside Node-RED.

  1. create node 'http in'
  2. create node 'template'
  3. create node 'debug'

I am wondering how do i pick each value up from received form data.
I want to pick filename, form-data up.

[{"id":"da61568.38e3ea8","type":"template","z":"4fa5208f.bd0e1","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"msg.req.headers : {{msg.req.files}}\nmsg.headers : {{msg.headers}}\nFile Name :  {{msg.req.headers.filename}}\nDATA_KEY : {{payload.filename}}\n*************************\n{{payload}}","output":"str","x":260,"y":300,"wires":[["d720d871.e20d08","5c5f2347.23f1bc"]]}]

[received data]

-----------------------------8d81dc92a6984d2
Content-Disposition: form-data; name="uploadFile0"; filename="log.jpg"
Content-Type: multipart/form-data

����JFIF��C
aa



��C		

��//"��a	��1a!1A"Qa�2q#%������!1A�"��?���y��y���UQ_�!�3�ug��I��L}�)����,�v�$FR��s�o��ۈ�V��1d�ɔ�H𢠸����>����-��%�b�o3.)�)m�h���e�
��k�~"��M:�(Т*$�-,a��+�F�ϻoƩ�mU�G�+��΍�r+�_���\V�7���]��lpC�D���uډЄ߈�&M���F�����̫��%
�?w*%@��Ҧ7�E�i �V�2 �o�m��������h�1x��//�.)��eS#)�����)��I���5{�56[iۥ�?,�а�Q#n� vף�K�1ډ�rS��FT��;��@j����#:z���Mj�D�a1���߷6�m'J5C�...

maybe have a look at this flow ? https://flows.nodered.org/flow/215e3f0ac615ef8a644dbc7aa72b2af9

Thank you :slight_smile:

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