Upload Content
- async AsyncCogniteClient.data_modeling.files.upload_content(
- path: Path,
- node_id: NodeId | tuple[str, str],
Upload content to an existing file node by instance ID.
- Parameters:
path (Path) – Path to the file to upload.
node_id (NodeId | tuple[str, str]) – Instance ID of the file node.
Examples
Upload file content by instance ID:
>>> from pathlib import Path >>> from cognite.client import CogniteClient >>> from cognite.client.data_classes.data_modeling import NodeId >>> client = CogniteClient() >>> client.data_modeling.files.upload_content( ... Path("/path/to/file.txt"), NodeId("my-space", "my-file") ... )