Skip to main content

Definition

Assembly: CloudNimble.Breakdance.Assemblies.dll Namespace: MimeTypes Inheritance: System.Object

Syntax

MimeTypes.MimeTypeMap

Summary

Class MimeTypeMap.

Methods

GetExtension

Gets the extension from the provided MINE type.

Syntax

public static string GetExtension(string mimeType, bool throwErrorIfNotFound = true)

Parameters

NameTypeDescription
mimeTypestringType of the MIME.
throwErrorIfNotFoundboolif set to true, throws error if extension’s not found.

Returns

Type: string The extension.

Exceptions

ExceptionDescription
ArgumentNullException
ArgumentException

GetMimeType

Gets the type of the MIME from the provided string.

Syntax

public static string GetMimeType(string str)

Parameters

NameTypeDescription
strstringThe filename or extension.

Returns

Type: string The MIME type.

Exceptions

ExceptionDescription
ArgumentNullException

TryGetMimeType

Tries to get the type of the MIME from the provided string.

Syntax

public static bool TryGetMimeType(string str, out string mimeType)

Parameters

NameTypeDescription
strstringThe filename or extension.
mimeTypestringThe variable to store the MIME type.

Returns

Type: bool The MIME type.

Exceptions

ExceptionDescription
ArgumentNullException