System functions - EncodeBase64

Page / - last modified by Assala Chmiti on 2021/12/13 16:34

EncodeBase64

last modified by Assala Chmiti

on 2021/12/13 16:34

Table of Contents

Introduction:

EncodeBase64 function Explanation:

Introduction:

This page is an introduction to the System functions EncodeBase64 that is used in order to encode a data. Base64 encoding function are commonly used when there is a need to encode binary data, especially when that data needs to be stored and transferred over media that are designed to deal with text. This encoding helps to ensure that the data remains intact without modification during transport and traduction.

EncodeBase64 function Explanation:

Definition:

This fucntion is used to encode a content source (File or Text) to an output content (Text).

The content source is a human-readable format and it's transformed to an illisible format in base 64.

How to use the function? :

The EncodeBase64 funtion have 2 necessary parameters:

The 1st parameter is the Source that indicates if the content source is a file (BINARY) or a text (TXT). This parameter accepts just BINARY or TXT, otherwise, an error is generated.

The 2nd parameter is the one that contains the value to be transformed in Base64. There are 2 cases: when Source equals to TXT, the Param2 is a String value or when Source equals to BINARY, the Param2 is the connector's name that contains the file.

You can call this function inside a stylesheet and use it for a mapping or you can call it inside a connector, but the declaration differs in each case.

First case:

In an XSL, to call this system function, we use this form ixf:EncodeBase64('TXT Or BINARY','Connector containing the file Or Value that you want to encode in Base64').

Ex:

Second case:

In the scenario, to call this system function inside a connector, we use this form {System.EncodeBase64;TXT Or BINARY;Connector containing the file Or Value that you want to encode in Base64}.

Ex : ​​​​​​​

The result of this function :

This function returns a String value of the encoded 2nd parameter value in Base64.

Return: The encoded value in Base64 .