Table of Contents

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

mimeType string

Type of the MIME.

throwErrorIfNotFound bool

if set to true, throws error if extension's not found.

Returns

string

The extension.

Exceptions

ArgumentNullException
ArgumentException

GetMimeType(string)

Gets the type of the MIME from the provided string.

public static string GetMimeType(string str)

Parameters

str string

The filename or extension.

Returns

string

The MIME type.

Exceptions

ArgumentNullException

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

str string

The filename or extension.

mimeType string

The variable to store the MIME type.

Returns

bool

The MIME type.

Exceptions

ArgumentNullException