> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Storage

> Durable space files and live runtime file movement.

BCTRL has two file surfaces:

* Space storage stores durable files scoped to a space.
* Runtime files move files into or out of a live runtime.

## Space storage

Use space storage for reusable inputs and durable outputs.

```ts
const uploaded = await space.storage.files.upload(csvBuffer, {
  path: "inputs/accounts.csv",
  contentType: "text/csv",
});

const { files } = await space.storage.files.list({
  prefix: "inputs/",
});
```

## Runtime files

Use runtime files when a browser or agent needs a real file path inside the live runtime.

```ts
const staged = await runtime.files.stage({
  fileId: uploaded.id,
});

console.log(staged.path);
```

Collect a runtime-local file back into storage.

```ts
const collected = await runtime.files.collect({
  path: "/tmp/export.csv",
  storagePath: "outputs/export.csv",
});
```

## Artifacts

When collected or captured files are outputs of a run, read them through run artifacts.

```ts
const run = await runtime.currentRun();
const { artifacts } = await run.artifacts.list();
```

## Related

* [Space Storage](/sdk/resources/storage)
* [Run Artifacts](/sdk/observability/run-artifacts)
* [Runtime Files](/api/api-reference/runtime-files/stage-file)