Home Search

DriveWorks Pro 22
Base64 Encode File

Send Feedback

Base64 Encode File

The Base64 Encode File Task, when applied, will encode a file into a Base64 string.


Property NameDescription
Constant NameThe name of the constant to drive (including the DWConstant prefix).
File PathThe path to the file which will be encoded into a Base64 string.
TitleChanges the Title (not the name) of the task.


To encode the content of the file MyData.txt, which contains the text "DriveWorks Documentation":

PropertyExample ruleExample resultMeaning
Constant NameDWConstantBase64EncodeFileResultRHJpdmVXb3JrcyBEb2N1bWVudGF0aW9uDriveWorks will put the encoded content in the constant called Base64EncodeFile.
File PathDWVariableDataLocation & FileToEncodeReturnIf the variable DataLocation equals "C:\DataToEncode\" and the FileToEncode control value equals "MyData.txt", the path would be evaluated to "C:\DataToEncode\MyData.txt".DriveWorks will encode the content of the file "C:\DataToEncode\MyData.txt".

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:


  • Encoded the file and applied it to the constant.

Success with Warnings

  • N/A - should never be fulfilled.

Failed (one of the following occurred)

  • No file was specified.
  • No constant was specified.
  • Path to file could not be resolved.
  • Path was invalid.
  • Path was too long.
  • File does not exist.
  • Insufficient permissions.
  • Could not find constant with the name provided.
  • General failure - Check the specification report for more details.