def METHOD_NAME(self, session, path):
    target = os.path.basename(path)
    text_file = os.path.splitext(target)[1] in ('.txt', '.xml', '.html')
    if text_file and sys.version_info[0] < 3:
        mode = 'r'
    else:
        mode = 'rb'
    try:
        with open(path, mode) as f:
            if text_file:
                session.storlines('STOR %s' % (target), f)
            else:
                session.storbinary('STOR %s' % (target), f)
    except Exception as ex:
        return False, repr(ex)
    return True, 'OK'