IHP Api Reference
Copyright(c) digitally induced GmbH 2021
Safe HaskellNone

IHP.FileStorage.MimeTypes

Description

 
Synopsis

Documentation

guessMimeType :: Text -> Text Source #

Returns the mime type based on a file extension

>>> guessMimeType "test.jpg"
"image/jpeg"

Returns application/octet-stream if no extension is given or it's unknown:

>>> guessMimeType "unknown"
"application/octet-stream"

extensionToMimeTypeMapping :: [(Text, Text)] Source #

List of mime types

Generated using:

>>> wget -qO- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | egrep -v ^# | awk '{ for (i=2; i<=NF; i++) {print "(\""$i"\", \""$1"\")"}}' | sort