Class MimeUtil

    Definition

    Namespace:
    Tizen.Content.MimeType
    Assembly:
    Tizen.Content.MimeType.dll

    The MimeUtil API provides functions to map the MIME types to file extensions and vice versa.

    public static class MimeUtil
    Inheritance
    object
    MimeUtil
    Remarks

    Conversions are provided from the file extensions to MIME types and from the MIME types to file extensions.

    Methods

    View Source

    GetFileExtension(string)

    Gets the file extensions for the given MIME type.

    Declaration
    public static IEnumerable<string> GetFileExtension(string mime)
    Parameters
    Type Name Description
    string mime

    The MIME type.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><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 ('.').

    Remarks

    Conversions are provided from the file extensions to MIME types and from the MIME types to file extensions.

    Examples
        var extColl = MimeUtil.GetFileExtension("video/mpeg");
        foreach ( string obj in extColl )
        {
            Console.WriteLine(obj);
        }
    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
    public static string GetMimeType(string fileExtension)
    Parameters
    Type Name Description
    string fileExtension

    The file extension.

    Returns
    Type Description
    string
    Remarks

    Conversions are provided from the file extensions to MIME types and from the MIME types to file extensions.

    Examples
        string mimeType = MimeUtil.GetMimeType("png");
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX