/// <summary> /// Gets the type of the MIME from the provided string. /// </summary> /// <param name="str">The filename or extension.</param> /// <returns>The MIME type.</returns> /// <exception cref="ArgumentNullException" /> public static string GetMimeType(string str) { return(MimeTypeMap.TryGetMimeType(str, out var result) ? result : DefaultMimeType); }