In the registry of my W10 box there is an extensive list mapping content-type to .extn
:
[HKEY_CLASSES_ROOT\MIME\Database\Content Type]
You might like to explore the HtmlAgilityPack OSS project which has source file HtmlWeb.cs
containing the following methods:
public static string GetContentTypeForExtension(string extension, string def)
public static string GetExtensionForContentType(string contentType, string def)
There is also [commented-out] Dictionary and population code:
//private static Dictionary<string, string> _mimeTypes;
// _mimeTypes = new Dictionary<string, string>();
// _mimeTypes.Add(".3dm", "x-world/x-3dmf");
// _mimeTypes.Add(".3dmf", "x-world/x-3dmf");
// ...
// _mimeTypes.Add(".zoo", "application/octet-stream");
// _mimeTypes.Add(".zsh", "text/x-script.zsh");
So you may brew your own (maybe just the common ones that YOUR app needs) for efficiency.
FYI the authoritative list of content-type values and usage is here:
www.iana.org/assignments/media-types/media-types.xhtml