@classmethod
def _guess_mimetype(cls, filename):
    """Guesses the MIME type from the filename.

        :return: the MIME type
        :rtype: str
        """
    import mimetypes
    mimetype, _ = mimetypes.guess_type(filename, strict=False)
    return mimetype
