Class MimeMapping
- Namespace
- Icy.Assets
- Assembly
- IcyUI.dll
Provides utilities for mapping file names and extensions to MIME-types.
public static class MimeMapping
- Inheritance
-
MimeMapping
- Inherited Members
Properties
FallbackMimeType
Gets or sets the fallback MIME-type. Defaults to application/octet-stream.
public static string FallbackMimeType { get; set; }
Property Value
Methods
GetMimeType(string)
Gets the MIME-type for the given file name, or FallbackMimeType if a mapping doesn't exist.
public static string GetMimeType(string fileName)
Parameters
fileNamestringThe name of the file.
Returns
- string
The MIME-type for the given file name.
GetMimeTypeExtensions(string)
Attempts to fetch all available file extensions for a MIME-type.
public static IEnumerable<string> GetMimeTypeExtensions(string mimeType)
Parameters
mimeTypestringThe name of the MIME-type.
Returns
- IEnumerable<string>
All available extensions for the given MIME-type.
TryGetMimeType(string?, out string?)
Tries to get the MIME-type for the given file name.
public static bool TryGetMimeType(string? fileName, out string? mimeType)
Parameters
Returns
- bool
trueif a MIME-type was found,falseotherwise.