Unable to decode base64 value

Hi,
I’m getting an encoded test from SNS which can decode base64 using online tool but
when I use “Base64.decode($content)” in map i’m getting below error, can someone please help

Failure: Unable to decode base64 value, Reason: Bad Base64 input character decimal 123 in array position 0, Resolution: Make sure the argument is valid base64

Thanks,
DK

Can you post the Base64 content (assuming it is not sensitive!)?

Hi Deepak,

Quick question, has the $content object has already been encoded to base64 (usually needs to encode since content is a binary)

Try, Base64.decode(Base64.encode($content))

Thanks

Thanks, It worked :grinning:

Note: This is equivalent to $content. Also, our preview UI sometimes erroneously shows binary content as “Base64-encoded” when it’s actually not. It’s just an array of bytes. See Convert Base64 to HEX - #5 by ptaylor

1 Like