Choose where you’d like to start

Set File Name

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 setFileName task is used to set the specified name for a file object.

Syntax

<file_variable>.setFileName(<name>);

where:

ParamsData typeDescription

<file_variable>

FILE

The file that needs to be named.

Note: Only the files fetched using the invoke URL task can be used.

<name>

TEXT

The name that needs to be set to the file object.

Note: Please make sure the file name doesn't contain any restricted characters.

Example

The following example sets the name - sampleFile for the file fetched from the web:

 response = invokeUrl
 [
  url: "http://www.africau.edu/images/default/sample.pdf"
  type: GET
 ];
 
 response.setFileName("sampleFile");

where:

response
The FILE that needs to be named.
"sampleFile"
The TEXT that represents the name that needs to be set to the file object.

Related Links

Get Started Now

Execute