Get File Size
Table of Contents
Description
The getFileSize task is used to get the size (in bytes) of the specified file.
Syntax
<response> = <file_object>.getFileSize();
where,
Params | Data type | Description |
<response> | TEXT | specifies the response returned by the getFileSize task. It represents the size (in byes) of the file. |
<file_object> | FILE | specifies the file object whose size has to be fetched. The file can be fetched from the cloud using the invokeUrl task. |
Example
The following script returns the size (in bytes) 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 size of the file
response = fileVariable.getFileSize(); // returns 545 (bytes)
where,
response
fileVariable