Sisk

Method

MimeHelper.GetFileExtension

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

GetFileExtension(string, string?) #

Gets the file extension for the specified MIME type.

C#
public static string? GetFileExtension(string mimeType, string? fallback = null)

Parameters #

mimeType string

The MIME type, optionally including parameters such as ; charset=utf-8.

fallback string?

Optional. The default extension when no match is found.

Returns #

string?

The file extension without the leading dot (e.g. html), or fallback if the MIME type is not recognized.

Type to search the documentation and the API reference.