# Write binary objects or images

Publish / file

A variant of [Write another file format](https://meridian.online/operations/write-another-file-format).

Write the binary content or image held in each row to its own file.

Page: <https://meridian.online/operations/write-another-file-format/write-binary-objects-or-images>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today.

## The DuckDB step

write the binary content of each row to its own file

```sql
CREATE TEMP TABLE blobs AS SELECT * FROM (VALUES ('one', 'first file'::BLOB), ('two', 'second file'::BLOB), ('three', '\x00\x01\xff'::BLOB)) t(name, content);
COPY (SELECT name, content FROM blobs) TO '<your_scratch_dir>/blobs' (FORMAT blob, PARTITION_BY (name));
CREATE TEMP TABLE result AS
SELECT regexp_extract(filename, 'name=([^/]+)/', 1) AS name, content FROM read_blob('<your_scratch_dir>/blobs/*/*');
SELECT name, octet_length(content) AS size FROM result ORDER BY name;
SELECT CASE WHEN ((SELECT count(*) = 3 FROM result) AND (SELECT count(*) FROM result r JOIN blobs b USING (name) WHERE r.content = b.content) = 3) THEN 'as expected' ELSE error('the three rows were not written to three files holding exactly their bytes') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

It reads this from `<your_scratch_dir>`, which you supply:

- `blobs`: An empty directory.

It needs nothing installed beyond DuckDB itself.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- Azure Data Factory: [`Binary format (sink)`](https://learn.microsoft.com/en-us/azure/data-factory/format-binary) (read 2026-09-27)
- Alteryx Designer: [`Blob Output`](https://help.alteryx.com/current/en/designer/tools/developer/blob-output-tool.html) (read 2026-09-27)
- Alteryx Designer: [`Image Output`](https://help.alteryx.com/current/en/designer/tools/alteryx-intelligence-suite/computer-vision/image-output.html) (read 2026-09-27)
- Apache Hop: [`Binary File Output`](https://hop.apache.org/manual/latest/pipeline/transforms/binaryfileoutput.html) (read 2026-09-27)
- KNIME Analytics Platform: [`Image Writer (Port)`](https://api.hub.knime.com/nodes/*2uLHdG65k5PHXCbF?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Image Writer (Table)`](https://api.hub.knime.com/nodes/*KpOZsZ-XlSa0lQE1?details=full) (read 2026-09-27)
- RapidMiner Studio: [`Write File`](https://docs.rapidminer.com/latest/studio/operators/utility/files/write_file.html) (read 2026-09-27)
- RapidMiner Studio: [`Write Image`](https://docs.rapidminer.com/latest/studio/operators/extensions/Image%20Processing/data_access/write_image.html) (read 2026-09-27)
- VisiData: [`png (saver)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/png.py#L62) (read 2026-09-23)
