> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/data/binary-data.md).

# Work with files and images in Duaer

Understand and use binary data in Duaer.
Binary data is any file-type data, such as images or documents. A file does not live in json. It sits on binary on the same item, under a name such as invoice.

```
"binary": {
	"invoice": {
		"data": "<base64>",
		"mimeType": "application/pdf",
		"fileName": "invoice.pdf",
		"fileExtension": "pdf"
	}
}
```

## Working with binary data in your workflow <a href="#working-with-binary-data" id="working-with-binary-data"></a>

You can use nodes or code. Key nodes:

- Convert to File: turn text, JSON, or a spreadsheet into a file on binary.
- Extract From File: read a file on binary back into rows or text.
- Read/Write Files from Disk: read and write the machine disk when you self-host. A cloud instance does not have your disk.
- HTML, XML, Compression, Edit Image, and FTP also take and return binary slots.

## Configure binary data mode when self-hosting <a href="#configure-binary-data-mode-when-self-hosting" id="configure-binary-data-mode-when-self-hosting"></a>

On a self-hosted instance, choose where binary data is stored with environment variables such as DUAER_DEFAULT_BINARY_DATA_MODE (default keeps data in memory; filesystem, s3, azure, or database select those stores), DUAER_BINARY_DATA_STORAGE_PATH, and DUAER_AVAILABLE_BINARY_DATA_MODES.

Changing the store does not change the binary name a node uses. You cannot pin output that includes binary. When execution data is redacted, binary is removed from the record.
## Questions

### Where does a file sit on an item?

In Duaer, not in json. On binary under a name such as invoice, with base64 in data plus mimeType, fileName, and fileExtension.

### How do you choose binary storage when self-hosting, and can you pin binary output?

In Duaer, use environment variables such as DUAER_DEFAULT_BINARY_DATA_MODE for memory, filesystem, or external stores. You cannot pin output that includes binary. Redaction removes binary from the execution record.

## Related

- [Understand Duaer’s data structure](https://doc.duaer.com/data/data-structure.md)
- [Pin data in Duaer](https://doc.duaer.com/data/data-pinning.md)
- [Redact execution data in Duaer](https://doc.duaer.com/Duaer-Organizations/executions/execution-data-redaction.md)

