Skip to content

Commit

Permalink
Updated MIME-Type to file extension mappings
Browse files Browse the repository at this point in the history
Fixes issue #844
  • Loading branch information
jstedfast committed Oct 10, 2022
1 parent 82aae60 commit f52cc98
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions MimeKit/MimeTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace MimeKit {
/// </remarks>
public static class MimeTypes
{
// Note: The official mime-type registry can be found at https://www.iana.org/assignments/media-types/media-types.xhtml
static readonly Dictionary<string, string> extensions;
static readonly Dictionary<string, string> mimeTypes;

Expand Down Expand Up @@ -85,6 +86,7 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".avi", "video/avi" },
{ ".avs", "video/avs-video" },
{ ".axs", "application/olescript" },
{ ".azw", "application/vnd.amazon.ebook" },
{ ".bas", "text/plain" },
{ ".bcpio", "application/x-bcpio" },
{ ".bin", "application/octet-stream" },
Expand Down Expand Up @@ -153,6 +155,7 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".dxr", "application/x-director" },
{ ".el", "text/x-script.elisp" },
{ ".elc", "application/x-elc" },
{ ".emf", "image/emf" },
{ ".eml", "message/rfc822" },
{ ".eot", "application/vnd.bw-fontobject" },
{ ".eps", "application/postscript" },
Expand Down Expand Up @@ -201,7 +204,7 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".htm", "text/html" },
{ ".htt", "text/webviewhtml" },
{ ".htx", "text/html" },
{ ".ico", "image/x-icon" },
{ ".ico", "image/vnd.microsoft.icon" },
{ ".ics", "text/calendar" },
{ ".idc", "text/plain" },
{ ".ief", "image/ief" },
Expand Down Expand Up @@ -231,8 +234,9 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".jpe", "image/jpeg" },
{ ".jpg", "image/jpeg" },
{ ".jps", "image/x-jps" },
{ ".js", "application/javascript" },
{ ".js", "text/javascript" },
{ ".json", "application/json" },
{ ".jsonld", "application/ld+json" },
{ ".jut", "image/jutvision" },
{ ".kar", "audio/midi" },
{ ".ksh", "text/x-script.ksh" },
Expand Down Expand Up @@ -273,6 +277,7 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".mif", "application/x-mif" },
{ ".mjf", "audio/x-vnd.AudioExplosion.MjuiceMediaFile" },
{ ".mjpg", "video/x-motion-jpeg" },
{ ".mjs", "text/javascript" },
{ ".mm", "application/base64" },
{ ".mme", "application/base64" },
{ ".mny", "application/x-msmoney" },
Expand Down Expand Up @@ -313,15 +318,17 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".nvd", "application/x-navidoc" },
{ ".nws", "message/rfc822" },
{ ".oda", "application/oda" },
{ ".ods", "application/oleobject" },
{ ".odp", "application/vnd.oasis.opendocument.presentation" },
{ ".ods", "application/vnd.oasis.opendocument.spreadsheet" },
{ ".odt", "application/vnd.oasis.opendocument.text" },
{ ".oga", "audio/ogg" },
{ ".ogg", "audio/ogg" },
{ ".ogv", "video/ogg" },
{ ".ogx", "application/ogg" },
{ ".omc", "application/x-omc" },
{ ".omcd", "application/x-omcdatamaker" },
{ ".omcr", "application/x-omcregerator" },
{ ".opus", "audio/ogg" },
{ ".opus", "audio/opus" },
{ ".otf", "font/otf" },
{ ".oxps", "application/oxps" },
{ ".p10", "application/pkcs10" },
Expand Down Expand Up @@ -388,6 +395,7 @@ static Dictionary<string, string> LoadMimeTypes ()
{ ".qt", "video/quicktime" },
{ ".ra", "audio/x-pn-realaudio" },
{ ".ram", "audio/x-pn-realaudio" },
{ ".rar", "application/vnd.rar" },
{ ".ras", "application/x-cmu-raster" },
{ ".rast", "image/cmu-raster" },
{ ".rexx", "text/x-script.rexx" },
Expand Down Expand Up @@ -664,6 +672,7 @@ static Dictionary<string, string> LoadExtensions ()
{ "application/toolbook", ".tbk" },
{ "application/typescript", ".ts" },
{ "application/vda", ".vda" },
{ "application/vnd.amazon.ebook", ".azw" },
{ "application/vnd.bw-fontobject", ".eot" },
{ "application/vnd.fdf", ".fdf" },
{ "application/vnd.hp-HPGL", ".hgl" },
Expand All @@ -687,13 +696,17 @@ static Dictionary<string, string> LoadExtensions ()
{ "application/vnd.ms-works", ".wcm" },
{ "application/vnd.ms-xpsdocument", ".xps" },
{ "application/vnd.nokia.configuration-message", ".ncm" },
{ "application/vnd.oasis.opendocument.presentation", ".odp" },
{ "application/vnd.oasis.opendocument.spreadsheet", ".ods" },
{ "application/vnd.oasis.opendocument.text", ".odt" },
{ "application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx" },
{ "application/vnd.openxmlformats-officedocument.presentationml.slideshow", ".ppsx" },
{ "application/vnd.openxmlformats-officedocument.presentationml.template", ".potx" },
{ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx" },
{ "application/vnd.openxmlformats-officedocument.spreadsheetml.template", ".xltx" },
{ "application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx" },
{ "application/vnd.openxmlformats-officedocument.wordprocessingml.template", ".dotx" },
{ "application/vnd.rar", ".rar" },
{ "application/vnd.rn-realmedia", ".rm" },
{ "application/vnd.rn-realplayer", ".rnx" },
{ "application/vnd.wap.wmlc", ".wmlc" },
Expand Down Expand Up @@ -830,6 +843,7 @@ static Dictionary<string, string> LoadExtensions ()
{ "audio/mpeg", ".mp3" },
{ "audio/nspaudio", ".la" },
{ "audio/ogg", ".ogg" },
{ "audio/opus", ".opus" },
{ "audio/s3m", ".s3m" },
{ "audio/tsp-audio", ".tsi" },
{ "audio/tsplayer", ".tsp" },
Expand Down Expand Up @@ -861,6 +875,7 @@ static Dictionary<string, string> LoadExtensions ()
{ "image/bmp", ".bmp" },
{ "image/cis-cod", ".cod" },
{ "image/cmu-raster", ".rast" },
{ "image/emf", ".emf" },
{ "image/fif", ".fif" },
{ "image/g3fax", ".g3" },
{ "image/gif", ".gif" },
Expand All @@ -874,15 +889,16 @@ static Dictionary<string, string> LoadExtensions ()
{ "image/tiff", ".tif" },
{ "image/vasa", ".mcf" },
{ "image/vnd.fpx", ".fpx" },
{ "image/vnd.microsoft.icon", ".ico" },
{ "image/vnd.rn-realflash", ".rf" },
{ "image/vnd.rn-realpix", ".rp" },
{ "image/vnd.wap.wbmp", ".wbmp" },
{ "image/vnd.xiff", ".xif" },
{ "image/webp", ".webp" },
{ "image/wmf", ".wmf" },
{ "image/x-cmx", ".cmx" },
{ "image/x-emf", ".emf" },
{ "image/x-dwg", ".svf" },
{ "image/x-icon", ".ico" },
{ "image/x-jg", ".art" },
{ "image/x-jps", ".jps" },
{ "image/x-niff", ".niff" },
Expand Down Expand Up @@ -915,6 +931,7 @@ static Dictionary<string, string> LoadExtensions ()
{ "text/h323", ".323" },
{ "text/html", ".html" },
{ "text/iuls", ".uls" },
{ "text/javascript", ".js" },
{ "text/markdown", ".md" },
{ "text/pascal", ".pas" },
{ "text/plain", ".txt" },
Expand Down

0 comments on commit f52cc98

Please sign in to comment.