util.Strings.base64Encode()
converts the content of a file to a Base64 encoded string.
Syntax:
util.Strings.base64Decode(filename)
Parameters:
|
filename |
the name of the file that must be converted (STRING) |
Usage and examples:
util.Strings.base64Encode()
|
example code #1 (a .txt file) |
MAIN DISPLAY util.Strings.base64Encode("test.txt") CALL fgl_getkey() END MAIN |
|
|
obtained results #1 |
|
|
|
example code #2 (a .png file) |
MAIN DISPLAY util.Strings.base64Encode("attention.png") CALL fgl_getkey() END MAIN |
|
|
obtained results #2 |
|
|
|
example code #3 |
MAIN DEFINE base64 STRING LET base64 = util.Strings.base64Encode("attention.png") CALL util.Strings.base64Decode(base64, "attention_new.png") CALL fgl_getkey() END MAIN |
|
|
obtained results #3 |
|
|