1
0

mime.luadoc 804 B

12345678910111213141516171819202122232425262728293031323334
  1. ---[[
  2. LuCI http protocol implementation - mime helper class.
  3. This class provides functions to guess mime types from file extensions and
  4. vice versa.
  5. ]]
  6. module "luci.http.mime"
  7. ---[[
  8. MIME mapping table containing extension - mimetype relations.
  9. @class table
  10. ]]
  11. ---[[
  12. Extract extension from a filename and return corresponding mime-type or
  13. "application/octet-stream" if the extension is unknown.
  14. @class function
  15. @name to_mime
  16. @param filename The filename for which the mime type is guessed
  17. @return String containign the determined mime type
  18. ]]
  19. ---[[
  20. Return corresponding extension for a given mime type or nil if the
  21. given mime-type is unknown.
  22. @class function
  23. @name to_ext
  24. @param mimetype The mimetype to retrieve the extension from
  25. @return String with the extension or nil for unknown type
  26. ]]