How can I decode base64 in serverside. ?
# suitescript
t
How can I decode base64 in serverside. ?
I only see encoding options.
m
In 2.x, the
N/encode
module can both encode and decode base64. In 1.0, There's an undocumented
nlapiDecrypt()
function that I've used without issue for years. NetSuite support has essentially acknowledged to me that it's supported despite the lack of documentation, but I don't expect any documentation updates for 1.0 functions at this point.
t
Thanks @MTNathan, I have to decode a base64 string to an Image. Either I am missing something, or this doesn't decode to image. Only applies to string
m
I'm probably not going to be much help on that front, but maybe once you've decoded the base64 string to UTF-8, you can use another tool to convert to an image?
b
N/encode only is for text strings, not for use with binary
You can directly create files with base 64 encoded images
t
Thanks, Can you please give me an example ?
I think I got this