Encode in Base64 Version 1 (Python)

Action group: Base actions  Subgroup: General


Description

The action encodes the data in the specified file in Base64.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Data type

The type of data to be encoded.

List elements: File, String.

Robin.String
yes
FilePath to file whose data will be encoded.Robin.PathToFile
no
StringString to be encoded.Robin.String
no
Results
ResultEncoded string.Robin.String

Special conditions of use

  1. To encode the user needs to specify the data type for encoding: file or string.
  2. If the user selected a data type, but did not specify the selected type (file/string), the action will display the error: "Input parameters are not filled correctly".
  3. The result of the action is a string with encoded data.
  4. There is a limitation on file size - 10MB. If you specify a larger file size, the action will generate an error in the form of a message: "The file size is larger than allowed".

Examples of use

Task 1

 Encode the data passed in the input file in Base64.

Solution

  1. Move the "Encode in Base64" action to the workspace.
  2. Set the parameters correctly. "Data type" - File.
  3. Start the robot.

Implementation

  1. Select the file to encode in Base64.
  2. Open the "Base actions" action group.
  3. Move the "Encode in Base64" action to the workspace.
  4. Click on the action.
  5. Action setting:
    1. "Data type" parameter. Select "File" from the dropdown list.
    2. In the"File" field specify the path to the file folder.

  6. Click "Start" in the top panel to start the robot.


Result

The output of the action was a string with Base64 encoded data.

Task 2

  1. If parameters are set incorrectly, for example, if the data type is "String", the "String" field should be left blank. 

2. Start the robot.

Result

The action encoded the specified string and returned a string with encoded data. The action did not touch the specified file.

Task 3

Repeat the case by specifying "Data type" - File. As a result, the action will not touch the specified string.

  • Нет меток