cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Unable to decode base64 value

deepak_shaw
Contributor

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

4 REPLIES 4

nravon
New Contributor

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 ๐Ÿ˜€

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