Upload Content Bytes

async AsyncCogniteClient.data_modeling.files.upload_content_bytes(
content: str | bytes | BinaryIO,
node_id: NodeId | tuple[str, str],
) None

Upload bytes or string content to an existing file node by instance ID.

Parameters:
  • content (str | bytes | BinaryIO) – The content to upload.

  • node_id (NodeId | tuple[str, str]) – Instance ID of the file node.

Examples

Upload bytes to an existing file node by instance ID:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.data_modeling import NodeId
>>> client = CogniteClient()
>>> client.data_modeling.files.upload_content_bytes(
...     b"some content", NodeId("my-space", "my-file")
... )