Class MimeUtil
Definition
- Namespace:
- Tizen.Content.MimeType
- Assembly:
- Tizen.Content.MimeType.dll
- API Level:
- 3
The MimeUtil API provides functions to map the MIME types to file extensions and vice versa.
C#Copypublic static class MimeUtil
- Inheritance
-
System.ObjectMimeUtil
Remarks
Conversions are provided from the file extensions to MIME types and from the MIME types to file extensions.
Methods
Declaration
C#Copypublic static IEnumerable<string> GetFileExtension(string mime)
Parameters
Type | Name | Description |
---|---|---|
System.String | mime | The MIME type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | If successful, returns the list of file extension strings for the given MIME type. The array of file extension is without the leading dot ('.'). |
Examples
Copyvar extColl = MimeUtil.GetFileExtension("video/mpeg"); foreach ( string obj in extColl ) { Console.WriteLine(obj); }
API Level: 3
View Source
GetMimeType(String)
Gets the MIME type for the given file extension. The MIME type is 'application/octet-stream' if the given file extension is not associated with specific file formats.
Declaration
C#Copypublic static string GetMimeType(string fileExtension)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileExtension | The file extension. |
Returns
Type | Description |
---|---|
System.String |
Examples
Copystring mimeType = MimeUtil.GetMimeType("png");