Get File Type
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.
The getFileType task is used to get the type of the specified file.
<response> = <file_object>.getFileType();
specifies the response returned by the getFileName task. It represents the name of the file.
specifies the file object whose type needs to be fetched. The file can be fetched from the cloud using the invokeUrl task.
The following script returns the type 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 file type response = fileVariable.getFileType(); // returns image/png