util.Strings.base64Decode

Decodes a Base64 encoded string and writes the bytes to a file.

Syntax

util.Strings.base64Decode(
  base64 STRING,
  filename STRING
 )
  1. base64 is the Base64 encoded string.
  2. filename is the name of the file to write to.

Usage

The util.Strings.base64Decode() method converts the Base64 encoded string passed as first parameter, and writes the bytes to file specified as second parameter.

This method is typically used for binary data. If the Base64 source string represents characters and contain a sequence of bytes that does not represent a valid character in the current application locale, the resulting file will be written without checking the encoding validity.

Example

IMPORT util
MAIN
    DEFINE base64 STRING
    LET base64 = util.Strings.base64Encode( "picture1.png" )
    DISPLAY base64
    CALL util.Strings.base64Decode( base64, "picture2.png" )
END MAIN