Saving a bas64 string to an image file

I am trying to save the image from a camera as an image file(.jpeg).

I currently ,I'm getting it as as base64 string. This was achieved by referring to the following link

I can use the following website to convert the file to an image

I was able to find the following forum thread that discusses it but Im not so clear on it
Saving images from URL to folder.

I have included my nodes implementing that solution but I think Im missing something
flows (4).json (1.2 KB)

Please assist
thank you

Hi @dinesh,
It is not entirely clear to me how your setup works.

You show a link to my multipart decoder node, that gets a continious stream of images (as NodJs raw buffers) from your cam. But that node is not used in your flow...

You can encode an image (= buffer) to a base64 string, and convert it back to a buffer. That can be done with the same node.
Bart

Hi,
Actually I did used your nodes exactly to read my camera but the output was coming as base 64 string.
But my intention is not to view the image and but save it.

So I created the nodes(which I uploaded) to read the base64 string and I was trying to find a way to convert it to an image file(.jpeg)..

Hi,
I did not realise that the buffer itself can be saved as an image file. I tried this and it worked. I was trying to read the base64 string but it did not cross my mind to file output the buffer directly.
My overall understanding is now a bit better

Thank you very much

2 Likes