Document to base64

Hello,

 

Is it possible to send/convert a document to base64 and send it to an external API from Creatio?

Example:
 

A)


B)

 

 

Thanks.

 

Like 0

Like

1 comments

Hello,

 

FileAPI returns the bytes array for the file content thus this bytes array can be used to convert the file content to base64 string like:

using System;
class Program
{
    static void Main()
    {
        byte[] byteArray = { 72, 101, 108, 108, 111 }; // "Hello" in ASCII
        string base64String = Convert.ToBase64String(byteArray);
 
        Console.WriteLine("Base64 String: " + base64String);
    }
}

This conversion should be implemented in the script-task element, and the result (base64String) should be set as a parameter value to be used elsewhere. 

Show all comments