Sisk

Method

MimeHelper.GetMimeType

Namespace
Sisk.Core.Helpers
Assembly
Sisk.Core.dll

GetMimeType(string, string?) #

Gets the content mime-type from the specified file extension.

C#
public static string GetMimeType(string fileExtension, string? fallback = null)

Parameters #

fileExtension string

The file extension, file path or the extension, with or without the dot.

fallback string?

Optional. The default mime-type when the file best mime-type is not found. If this argument is null, DefaultMimeType is used.

Returns #

string

The best matched mime-type, or the default if no mime-type was matched with the specified extension.

Type to search the documentation and the API reference.