Base64 encoding query

Hii everyone,
I am working on OTRS using HTTP REQUEST to create Ticket but I need to send attachment as well, which requires a parameter content which is base64 encoded

Sample is as follows

How do I get the content

Thanks and Regards,
Supriya

@supu123
You need to read the contents of the file and then convert them to base 64.
Here’s my workflow:

The line that does all the work is:
fileContentsBase64 = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(fileContents))

This converts the string I read from the file into a byte array and then converts that byte array to a base 64 string.

Before and after of text:
image

1 Like

Hi @DanielMitchell

For some file the attachment is blank

For Such files with big data

What to do in that case

Thanks and Regards,
Supriya

Hello SupRiys,
In this video, I upload a file to Salesforce from UiPath Studio using Conversion ToBase64:

Thanks,
Cristian Negulescu

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.