net.getmime(value)function
Returns the fully qualified MIME type for the given file or filename extension.
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, ornil if the MIME type cannot be found.
Example
--! luart-extensions
import console
local net = require "net"
local mime = net.getmime(console.readln('Enter a filename : '))
print('MIME type : '..mime)