import mimetypes


def get_mimetype(filename):
    """
    Get mimetype for local file

    filename: string representation of file's path
    """
    mime, mime_sub = mimetypes.guess_type(filename)

    if not mime:
        mime = "application/octet-stream"
    elif mime_sub:
        mime = f"{mime}+{mime_sub}"

    return mime