        shutil.copy(file_path, file_name)
    except Exception:
        raise Exception('Failed to prepare file for upload.')

    try:
        file_handler = open(file_name, 'rb')
        fname = os.path.basename(file_handler.name)
        encoded_file_name = base64.b64encode(fname.encode())
        file_data = file_handler.read()
        encoded_file_data = base64.encodebytes(file_data)
        file_handler.seek(0, os.SEEK_END)
        file_size = file_handler.tell()
        file_handler.close()

    finally: