Skip to content

getFileMimeType

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

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

getFileMimeType(file_name, callback, data)
Field Type Description
file_name string The name of the file or path to the file.

Example

  • Get the MIME type of a file, guessed by its extension.

    getFileMimeType('/tmp/photo.jpg')

    Response:

    {
      ["@type"] = "text",
      text = "image/jpeg"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally