Class MimeTypeUtils
Helper class for determining MIME content types based on file extensions
public static class MimeTypeUtils
- Inheritance
-
MimeTypeUtils
- Inherited Members
Methods
GetContentType(string)
Gets the MIME content type for a given file path based on its extension
public static string GetContentType(string path)
Parameters
pathstringThe file path
Returns
- string
The MIME content type, or "application/octet-stream" if unknown
GetSupportedExtensions()
Gets all supported extensions
public static IEnumerable<string> GetSupportedExtensions()
Returns
- IEnumerable<string>
A collection of all supported file extensions
IsSupported(string)
Checks if the given extension is supported
public static bool IsSupported(string extension)
Parameters
extensionstringThe file extension (including the dot)
Returns
- bool
True if the extension is supported, false otherwise