ftos.convert.byteArray.toBase64

This method takes a Blob containing raw binary data and returns its BASE64‑encoded form. It is available starting with Platform version 24.5.0. It supports Workflow Blob, it does not support byte array.

This is a business logic method for business service components.

Syntax

Copy
method ConvertByteArray.toBase64(blob: IFtosWorkflowBlob): string
Parameter Description
blob Converts the binary data contained in an into a BASE64‑encoded string.

Example

The following example downloads an image as raw bytes, then encodes those bytes as BASE64. The responseType is set to BYTEARRAY, so the SDK returns the image as raw binary data in input.Response. It then takes the raw byte array from the HTTP response, and converts those bytes into a BASE64 string. The result (output) is a text‑safe representation of the JPEG image.

Copy
var input = httpPost('https://httpbin.org/image/jpeg', null, { HttpVerb: 'GET', responseType: 'BYTEARRAY' });

var output = ftos.convert.byteArray.toBase64(input.Response);