Conversion to Base64 format


We have a requirement to call a webservice , Webservice is to load documents to the destination system . As an input argument Webservice expect document in Base64 format , can you please suggest how can i convert a .docx format to base64 format in UI Path .

Any quick help is welcome , looking forward for a quick suggestion here .


Hi @dubeychanan,

Refer this link,

If you want for some reason to convert your file to base-64 string. Like if you want to pass it via internet, etc… you can do this

Byte[] bytes = File.ReadAllBytes("path")
String file = Convert.ToBase64String(bytes)
And correspondingly, read back to file:

Byte[] bytes = Convert.FromBase64String(b64Str)
File.WriteAllBytes(path, bytes)


Thanks Arivu , this is an exceptional fast reply ,any suggestion how can i invoke this code in UI path .

Hi @dubeychanan,

Apply this code in your flow…and try it.


thanks for the code , I wanted to know how to execute this code in UI path Sequence , i mean any activity to do so , i m sorry for this question I am very new to UI Path

You can add into Invoke code activity
Note: Need to add respective namespace