Class MimeTypeMap
- Namespace
- GenerativeAI.Core
- Assembly
- GenerativeAI.dll
Class MimeTypeMap.
public static class MimeTypeMap
- Inheritance
-
MimeTypeMap
- Inherited Members
Methods
GetExtension(string, bool)
Gets the extension from the provided MIME type.
public static string GetExtension(string mimeType, bool throwErrorIfNotFound = true)
Parameters
mimeTypestringType of the MIME.
throwErrorIfNotFoundboolif set to
true, throws error if extension's not found.
Returns
- string
The extension.
Exceptions
GetMimeType(string)
Gets the type of the MIME from the provided string.
public static string GetMimeType(string str)
Parameters
strstringThe filename or extension.
Returns
- string
The MIME type.
Exceptions
TryGetMimeType(string, out string?)
Tries to get the type of the MIME from the provided string.
public static bool TryGetMimeType(string str, out string? mimeType)
Parameters
Returns
- bool
The MIME type.