Table of Contents

Class MimeTypeHelper

Namespace
CMS.Helpers
Assembly
CMS.Helpers.dll

Mime type helper.

public static class MimeTypeHelper
Inheritance
object
MimeTypeHelper

Methods

AddRule(string, string)

Adds the conversion rule to the conversion tables.

public static void AddRule(string mimetype, string extension)

Parameters

mimetype string

Mime type

extension string

Extension

GetExtension(string, string)

Gets the extension by mime type.

public static string GetExtension(string mimetype, string defaultValue = "")

Parameters

mimetype string

Mimetype

defaultValue string

Default value when extension is not found

Returns

string

GetMimetype(string, string)

Gets the mimetype by extension.

public static string GetMimetype(string extension, string defaultValue = "application/octet-stream")

Parameters

extension string

Extension

defaultValue string

Default value when extension is not found

Returns

string