Skip to content

getFileExtension

Sahri Riza Umami edited this page Jul 1, 2018 · 2 revisions

Returns the extension of a file, guessed by its MIME type.
Returns an empty string on failure.
This is an offline method.
Can be called before authorization.
Can be called synchronously.

getFileExtension(mime_type, callback, data)
Field Type Description
mime_type string The MIME type of the file.

Example

  • Get file's extension guessing only by its mime type.

    getFileExtension('application/javascript')

    Response:

    {
      ["@type"] = "text",
      text = "js"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally