Skip to main content
Volume transfer destinations and sources use absolute volume-internal paths rooted at /. They do not use sandbox cwd or sandbox user semantics.

Upload a file

result = volume.files.upload_file(
    "./model.bin",
    "/models/model.bin",
    resumable=True,
    checksum="auto",
    max_concurrency=4,
)
print(result.bytes_uploaded, result.target_path)

Upload a directory

result = volume.files.upload_dir("./datasets", "/datasets")
print(result.file_count)
Directory uploads support conflict=, ignore_patterns=, and max_concurrency=. File uploads support resumable transfer options such as resumable, checksum, and spool_to_disk. volume.files.upload() dispatches to the file or directory helper based on the local source type.

Resume upload

from nullspace import FileUploadError

try:
    volume.files.upload_file("./large.bin", "/models/large.bin", resumable=True)
except FileUploadError as exc:
    if exc.upload_id is None:
        raise
    volume.files.resume_upload(exc.upload_id, "./large.bin")

Download

volume.files.download_file("/models/model.bin", "./model.bin")
volume.files.download_dir("/datasets", "./datasets-copy", overwrite=True)
volume.files.download_dir("/datasets", "./datasets.tar", archive=True, overwrite=True)
print(volume.files.download_url("/models/model.bin"))
Downloads never overwrite existing local paths unless overwrite=True is set (CLI --force maps to SDK overwrite=True). Directory downloads fetch a tar archive internally; by default the SDK extracts it, and archive=True keeps the tar file instead.