# file.save

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/file-save/
Language: en

`type: "file.save"`

Writes a file into an object storage. The step that turns something a chain produced into something that exists.

Status: object storage · path required · content or base64

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storage` | string | required | An object storage. |
| `path` | string | required | Where to write it. |
| `content` | any |  | Text content. |
| `contentBase64` | string |  | Bytes. For anything that is not text. |

One of `content` and `contentBase64` is required.

```javascript
{ id: "save", type: "file.save", config: {
    storage: "…", path: "digests/{{input.week}}.pdf",
    contentBase64: "{{steps.pdf.output.base64}}" } }
```

## Binary goes in contentBase64 {#binary}

> **content is for text**
>
> A PDF or an image passed as content is written as the string it is not. The conversion step hands back base64 precisely so it can go straight into this field.

## Output {#output}

```javascript
{{steps.save.output.key}}
{{steps.save.output.size}}
{{steps.save.output.storage}}
```

## It counts against the storage {#quota}

A write past the ceiling is refused. On a scheduled chain that writes every run, that is a failure waiting for a date — worth a [usage](/sdk/ref/cloud/usage) check now and then.

## Against document.save {#versus}

This writes a file. [document.save](/sdk/workflows/steps/document-save) writes it *and* indexes it, so semantic search can find it later.

- [tools.convert](/sdk/workflows/steps/tools-convert): Producing the bytes.
- [document.save](/sdk/workflows/steps/document-save): Writing and indexing.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
{"id": "save", "type": "file.save", "config": {
    "storage": "…", "path": "digests/{{input.week}}.pdf",
    "contentBase64": "{{steps.pdf.output.base64}}"}}
```

```python
"{{steps.save.output.key}}"
"{{steps.save.output.size}}"
"{{steps.save.output.storage}}"
```
