How to get contentType from System.Drawing.Imaging.ImageFormat
See the question and my original answer on StackOverflowIf you want to determine the MIME type from a file name (or extension), here is a link that uses the registry: Get MimeType from a File Name