Choose where you’d like to start

Set File Type

Note: This function is applicable to all Zoho services except Zoho Creator.

Description

The setFileType task is used to set the specified file type to a file object. The file will be treated as the specified type while sending an HTTP request using the invoke URL task.

Note: If the actual file type and the assigned file type are incompatible, there might be issues when the user tries to open the file because this function does not actually convert the existing file type to the specified type.

Syntax

<file_variable>.setFileType(<type>);

where:

ParamsData typeDescription

<file_variable>

FILE

The file for which the file type needs to be specified.

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

<type>

TEXT

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

Allowed values: Any valid file type

Example

The following example sets the Type - pdf to the file fetched from the web:

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

where:

response
The FILE for which the file type needs to be specified.
"pdf"
The TEXT that represents the file type.

Related Links

Get Started Now

Execute