net.getmime(value)

Returns the fully qualified domain from an IP address (reverse DNS lookup).

Parameters

value

The value to retrieve the MIME type from, can be any of the following values :

  • A File value.
  • A string representing an URI or a filename.

Return value

Return a string representing the fully qualified MIME type, or nil if the MIME type cannot be found.

Example

local console = require "console" local net = require "net" local mime = net.getmime(console.readln('Enter a filename : ')) print('MIME type : '..mime)