Cannot convert base64 to buffer

Hey there,

I try to convert a base64 encoded picture to buffer but it does not work. I have no idea why it does not work..

normally the second debug should be a buffer?

Or am I just to stupid at the moment?

Hi @YT2310

The base64 node expects msg.payload to contain a base64 encoded string.

The first debug message shows what you actually have is a JSON string representation of an Array containing a base64 string.

If you replace the JSON node with the Change node configured to set msg.payload to the value of msg.payload[0], then you will be passing your base64 string to the base64 node as required.

1 Like