Choose where you’d like to start

Get File Size

Note: This function is applicable to all Zoho services. In Zoho Creator, this function can be applied only on files fetched using the invokeUrl task and not on the files fetched from Zoho Creator fields.

Description

The getFileSize task is used to get the size (in bytes) of the specified file.

Syntax

<response> = <file_object>.getFileSize();

where,

ParamsData typeDescription

<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
is the TEXT response returned by the getFileSize task. It represents the size of the specified file.
fileVariable
is the FILE variable that holds the file whose size needs to be fetched

Related Links

Get Started Now

Execute