Upload Image

Loads an image file or an image from a URL into a variable in the script.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

loadImage --file(String) (Image)=value

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
File file Required Text Full path of the image file or a variable with the image to be uploaded. URLs of images are also accepted.

Output parameters

Designer mode label Script mode name Accepted variable types Description
Image value Image Returns a variable with the loaded image.


Example 1: A new image is loaded, based on an image file, and assigned to the loadedImage variable.

defVar --name loadedImage --type Image
// Download the image file to insert it in the file parameter.
loadImage --file "imageForLoading.png" loadedImage=value

Example 2: Loads a new image from the Internet in a Image type variable.

defVar --name loadedImage --type Image
loadImage --file "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRt0Wl8ennSek_VmhnCXgi-_lR9_fpt1XFjuwGKCl-EQ5CEXiq1&s" loadedImage=value
logMessage --message "${loadedImage}" --type "Info"
Note:The variable of type Image can be viewed and inspected through the global variables by running the script in debug mode.