Get File Name
Table of Contents
Note:
- This function is applicable to all Zoho services.
- In Zoho Creator, this function can only be applied on files fetched using the invokeUrl task and not on the files fetched from Zoho Creator fields. To fetch name of the file uploaded in the file upload field, use actualName.
Description
The getFileName task is used to get the name of the specified file.
Syntax
<response> = <file_object>.getFileName();
where,
Params | Data type | Description |
<response> | TEXT | specifies the response returned by the getFileName task. It represents the name of the file. |
<file_object> | FILE | specifies the file object whose name has to be fetched. |
Example
The following script returns the name of the file that the variable - fileVariable holds.
// to fetch file from the cloud using invokeUrl task fileVariable = invokeUrl [ url: "https://sample-videos.com/img/Sample-png-image-100kb.png" type: GET ];
// to fetch the name of the file response = fileVariable.getFileName(); // returns Sample-png-image-100kb.png
where,
response
is the TEXT response returned by the getFileName task. It represents the name of the specified file.
fileVariable
is the FILE variable that holds the file whose name needs to be fetched