Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Encode Image to Base64 with Run Javascript Action


Hello!  The attached files are Image to Base64 encoder processes using Javascript, which are compatible with WinAutomation [Pro & Pro+ editions] and ProcessRobot.  They process was developed and tested on a Windows 10 machine.

Image to Base64 Encoder:

When you run the process a pop up window will appear allowing you to select the file to be encoded. Once you have selected your file, the process enters a function that escapes characters of the JavaScript string that could prevent interpretation.  The '%PathtoFileEscaped%' variable is then referred to in the 'Run Javascript' action, which processes the image and then outputs the Base64 encoding into a pop up window.  You can copy the output results from this window.

Batch Image to Base64 Encoder:

This version is useful if you have a batch of files that require encoding - the output will be stored into an excel file, in the folder directory selected at the beginning of the process. Column A will indicate the file path, while B will contain the Base64 encoding.  Please not that you can modify the 'Get Files in Folder' action 'File Filter' property (Main Function Action 2) to limit specific image files like *.jpg, *.png as required.


Thanks for sharing, the generated code has no prefix:


The image may be PNG, GIF, JPEG, etc.  Can you add it? thanks

Thank you.

hello is it possible to do the opposite.
thank you

Login or Signup to post a comment