Class MimeTypeDetector
MIME type detection. Initializes a new instance of the Terrasoft.Core.MimeTypeDetector class.
Inheritance
System.Object
MimeTypeDetector
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public static class MimeTypeDetector
Methods
GetMimeType(Byte[])
Determines the MIME type from the data provided.
Declaration
public static MimeTypeResult GetMimeType(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The byte array that is used to determine the MIME type. |
Returns
Type | Description |
---|---|
MimeTypeResult | Result of determine MIME type. Terrasoft.Core.MimeDetector.MimeTypeResult |
Remarks
If the file name with the extension is available in the code, use the method that takes the file name as a parameter.
GetMimeType(String)
Returns the MIME mapping for the specified file name.
Declaration
public static MimeTypeResult GetMimeType(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name that is used to determine the MIME type. |
Returns
Type | Description |
---|---|
MimeTypeResult | Result of determine MIME type. Terrasoft.Core.MimeDetector.MimeTypeResult |
Remarks
If the file name with the extension is available in the code, use the method that takes the file name as a parameter.