Lua primitives: mime_type()
This function will attempt to determine the correct MIME-type for the specified filename.
The MIME-type is determined by examining the filename extension, if present, and if the lookup fails then the default value of application/octet-stream will be returned.
The code to perform the lookup parses the system file /etc/mime.types, if present, and if that fails it will revert to a small list of known-values.
msg(mime_type( "/path/to/foo.jpg" ));
This will result in the message image/jpg being displayed.
This function has been available since version 0.09.