def METHOD_NAME(path, io_or_string, scope=OPENC3_SCOPE):
    if ".." in path:
        raise Exception(f"Disallowed path modifier '..' found in {path}")
    upload_path = f"{scope}/targets_modified/{path}"
    if os.environ["OPENC3_LOCAL_MODE"] and openc3.script.OPENC3_IN_CLUSTER:
        LocalMode.METHOD_NAME(upload_path, io_or_string, scope=scope)
        if hasattr(io_or_string, "read"):  # not str or bytes
            io_or_string.seek(0)
    endpoint = f"/openc3-api/storage/upload/{upload_path}"
    result = _get_presigned_request(endpoint, scope=scope)
    Logger.info(f"Writing {upload_path}")
    # Try to put the file
    try:
        uri = _get_uri(result["url"])
        with requests.Session() as s:
            if hasattr(io_or_string, "read"):
                # TODO: Better way to get io size?
                io_or_string.seek(0, 2)  # Jump to end
                length = io_or_string.tell()
                io_or_string.seek(0)
                io_or_string = io_or_string.read()
            else:  # str or bytes
                length = len(io_or_string)
            result = s.put(
                uri,
                data=io_or_string,
                headers={"Content-Length": str(length)},
            )
            return result.content
    except Exception as error:
        raise Exception(
            f"Failed to write {upload_path} due to {repr(error)}"
        ) from error