summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc
blob: 9c7f01aedf00732783c755ea510eabe0d193b4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---[[
LuCI http protocol implementation - mime helper class.

This class provides functions to guess mime types from file extensions and
vice versa.
]]
module "luci.http.mime"

---[[
MIME mapping table containing extension - mimetype relations.

@class table
]]

---[[
Extract extension from a filename and return corresponding mime-type or

"application/octet-stream" if the extension is unknown.
@class function
@name to_mime
@param filename	The filename for which the mime type is guessed
@return			String containign the determined mime type
]]

---[[
Return corresponding extension for a given mime type or nil if the

given mime-type is unknown.
@class function
@name to_ext
@param mimetype	The mimetype to retrieve the extension from
@return			String with the extension or nil for unknown type
]]