Convert Base64 string to Image

Hi All,

How can I easily convert base64 string to image in uipath using activities.
@loginerror @sudheern @Pablito @AndyMenon



How about the following expression?

img = New UiPath.Core.Image(Convert.FromBase64String(strBase64))

note: img is UiPath.Core.Image


In Invoke Code activity (C#)below code also worked:

String filePath = "MyImage.jpg";
File.WriteAllBytes(filePath, Convert.FromBase64String(base64imageString));

@Yoichi Thank you so much

1 Like

@Yoichi: to save image should we use save image activity


Even if we don’t know type of the image (such as png, jpg etc), contractor of UiPath.Core.Image can handle it properly and it can be saved as any image type using Save Image activity.

I think it’s useful in the above case, for example.


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