Get File Content
Table of Contents
Note:
Description
The getFileContent task is used to get the content of the specified file.
Syntax
<response> = <file_object>.getFileContent();
where,
Params | Data type | Description |
<response> | TEXT | specifies the response returned by the getFileContent task. It represents the content of the file. |
<file_object> | FILE | specifies the file object whose content has to be fetched. The file can be fetched from the cloud using the invokeUrl task. File types that usually contain only text values, (for example .txt, .csv etc.) will return the content accurately. File types that usually contain images, (for example .pdf, etc.) will return junk values. |
Example
The following script returns the content of the file that the variable - fileVariable holds.
// to fetch file from the cloud using invokeUrl task fileVariable = invokeUrl [ url: "http://insight.dev.schoolwires.com/HelpAssets/C2Assets/C2Files/C2ImportCalEventSample.csv" type: GET ];
// to fetch the file content response = fileVariable.getFileContent();
where,
response
is the TEXT response returned by the getFileContent task. It represents the content of the specified file.
fileVariable
is the FILE variable that holds the file whose content needs to be fetched