@staticmethod
def get_file_content(filepath):
    'Read and return file content Base64 encoded'
    if (not os.path.exists(filepath)):
        raise Exception(('File does not exists: %s' % filepath))
    if (not os.path.isfile(filepath)):
        raise Exception(('Not a file: %s' % filepath))
    content = None
    try:
        fdp = open(filepath, 'rb')
    except IOError:
        raise
    else:
        content = fdp.read()
        fdp.close()
    if (not content):
        raise Exception(('Error reading file or file empty: %s' % filepath))
    return base64.b64encode(content)
Read and return file content Base64 encoded
@staticmethod
def get_file_content(filepath):
    
    if (not os.path.exists(filepath)):
        raise Exception(('File does not exists: %s' % filepath))
    if (not os.path.isfile(filepath)):
        raise Exception(('Not a file: %s' % filepath))
    content = None
    try:
        fdp = open(filepath, 'rb')
    except IOError:
        raise
    else:
        content = fdp.read()
        fdp.close()
    if (not content):
        raise Exception(('Error reading file or file empty: %s' % filepath))
    return base64.b64encode(content)