BASE64_ENCODE

LANSA Composer

BASE64_ENCODE

This activity will base64 encode the contents of a specified file and write the encoded content to another file.

Base64 encoding is commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remains intact without modification during transport.  Base64 encoding is commonly used in a number of applications including email via MIME, and storing complex data in XML.

INPUT Parameters:

BASE64SOURCE : Required

This parameter must specify the full path and file name of the file whose contents are to be base64 encoded.

BASE64TARGET : Optional

This parameter may specify the full path and file name for the file to which the encoded file contents are to be written.  The default, if not specified, is the special value *AUTO.

If the special value *AUTO is used, the activity will use the path and file name specified in the BASE64SOURCE parameter but replacing the file extension with an extension of '.base64'.  For example, if you specify /myfolder/myfile.dat in the BASE64SOURCE parameter, then the activity will write the encoded contents to the file /myfolder/myfile.base64.

BASE64FOLD : Optional

This parameter specifies whether the activity should fold the encoded contents onto separate lines.  The default value *NO will not insert any line breaks in the encoded contents.  Alternatively you can specify *YES to cause the activity to insert a carriage-return and line-feed (CRLF) after every 76 characters of encoded output.

BASE64REPLACE : Optional

This parameter specifies what the activity should do if the output file already exists.  The default value *NO will cause the activity to end in error if the output file already exists.  Alternatively you can specify *YES to cause the existing file to be replaced.

OUTPUT Parameters:

BASE64ENCODED :

Upon successful completion, this parameter will contain the actual path and file name of the output file containing the encoded contents of the file specified by the BASE64SOURCE parameter.