attach file to workflow()

This function adds file b to workflow job a.

The value system is entered as the user of the file.

The return value of the function is true if the file was successfully added, otherwise false . Note : If a file with name a already exists, it will be overwritten. If c is not a Base64 encoded value, the file cannot be added successfully.

Parameters


Parameter

Description

a

Name (see VAR_SYS_WF_DISPLAYNAME) or ID (see VAR_SYS_WF_ID) of the workflow job.

b

Name of the file to be added.

c

Base64 encoded content of the file to be added. Note: See also function encode Base64().

d

(optional) If true, the file is set to read only. Default: false.

e

(optional) Name of the map whose entries will be used to insert user-defined file attributes. For each key in the map, a file attribute with the same name is created. The value of the attribute is the value of the map entry.

Note: See also function get content of attached file of workflow().

Example


Let's assume we want to add the file myfile_1.txt with content 111 to the workflow job named MyWorkflow 1628490814713. Note: The value MTEx is the Base-64 encoded value 111 (encoding 8859_1). See also function decode Base64().

Parameter a

b

c

d

e

Result

MyWorkflow 1628490814713

myfile_1.txt

MTEx



true

Binary files


If you want to attach a binary file (e.g. an image or PDF file), look at the functions read file into base64 coded byte-array() and load current backup data(). You can also use the EncodeBase64PreParser.