Decoding Base64

donkuelbs
Giga Contributor

Is there a method to decode base42 via script.   I don't see any functionality that would allow me to decode a base64 string?

I can write code and create a script include that would do the decoding but before I do that would like to see if that functionality isn't already supplied natively in the product.

Thanks in advance.

1 ACCEPTED SOLUTION

donkuelbs
Giga Contributor

Great - thanks.   We are planning on going to Istanbul next week anyway.   That will work for us.



Thanks again.


View solution in original post

3 REPLIES 3

Brian O_Donnell
Tera Guru

There is a "utility" GlideStringUtil that can be used in the global scope.


You can encode and decode:


var strEncodedString = GlideStringUtil.base64Encode('my_string');


GlideStringUtil.base64Decode(strEncodedString);



If you are in a scoped application, the GlideSystem object has methods:


gs.base64Decode()


gs.base64Encode()



The GlideSystem methods are available starting with Istanbul


OP should have marked your answer as correct instead of his own reply stating that you had the answer... ::slaps forehead::.... anyway,

 

Within your answer "GlideStringUtil.base64Decode(strEncodedString);" is the magic ingredient I was missing so I could do this:

find_real_file.png

 

So, THANK YOU for this answer!

donkuelbs
Giga Contributor

Great - thanks.   We are planning on going to Istanbul next week anyway.   That will work for us.



Thanks again.