Send files
Send a host file or folder into a Space: it lands in ~/Downloads, verified by SHA-256.
Send a host file or folder into a Space: it lands in ~/Downloads, verified by SHA-256.
send_file copies a host file or folder into the Space user's ~/Downloads
(or a subfolder). Every file is verified by SHA-256 before it is published; a
transfer that does not land is an error. For a folder, .gitignore, .ignore
and a root .dockerignore are honored (respect_ignore_files). Nothing
already in the Space is replaced by default: a file of the same name is kept
and the new copy lands as name (1).ext (conflict: "rename"). Pass
conflict: "skip" to keep only the existing file, or conflict: "overwrite"
to replace it.
From the examples in other languages:
const report = await this.space.sendFile(localPath, {
targetDirectory: subdir,
respectIgnoreFiles: true,
conflict: "rename",
})
if (!report.verified) throw new Error(`send_file of ${localPath} was not verified`)Python: await space.send_file(path, cua.SpaceSendFileOptions(target_directory="inbox")). Agents use
the MCP tool send_file (Use from an agent);
options are in the send_file reference.