<!-- BusyBot node reference — https://busybot.net/tools/read-binary-files/ -->

> Node: Read Binary Files (`read_binary_files`) · Action (binary) · v1
> Category: Core Nodes · Credentials: none
> Updated: 2026-08-16

# Read Binary Files

> Read multiple files matching a glob pattern from disk into binary data

## Overview

The Read Binary Files tool uses a glob pattern to find all files matching it within the execution files directory. Each matched file is read from disk and attached to its own output item as binary data, producing one output item per file with the file's metadata in JSON. This is a one-to-many node. The glob is executed once, and the output cardinality equals the number of matched files. If no files match, the node outputs an empty array (not an error). All filesystem operations are sandboxed to prevent directory traversal.

**Category:** Core Nodes  
**Tool Name:** `read_binary_files`  
**Version:** 1

**Appearance:** Icon: `lucide-FileDown` | Color: `#7D54C9`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool does not require any credentials.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File Selector | `string` | Yes | — | Glob pattern for files to read, relative to the execution files directory. Supports wildcards (\*, \*\*), character classes ([abc]), and negation (!pattern). Examples: "\*.jpg", "data/\*\*/\*.csv", "reports/2024-\*.pdf". |
| Binary Property | `string` | Yes | `data` | Name of the binary property to store the file contents under on each output item. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| Max Concurrency | `number` | No | `5` | Maximum number of files to read concurrently. Lower values reduce memory usage for large file sets. |

## Output Data

This node changes item cardinality: it emits **one output item per matched file**, not one per input item. The glob runs **once for the whole node**, using the File Selector as configured — so ten input items and a pattern matching three files still produce three output items, not thirty. Matches are returned in sorted order, so the output is deterministic.

If the pattern matches nothing, the node emits no items at all. That is not an error and nothing is routed to the Error output.

Each output item's JSON is the file's metadata only — the input item's own JSON is not carried over:

```json
{
  "mimeType": "image/jpeg",
  "fileType": "image",
  "fileName": "photo.jpg",
  "fileExtension": "jpg",
  "fileSize": "1.24 MB",
  "filePath": "uploads/2026/photo.jpg"
}
```

- `mimeType` — detected from the file name and its contents.
- `fileType` — the broad category from the MIME type (`image`, `audio`, `video`, `text` or `application`), or `unknown`.
- `fileName` — the bare file name including its extension.
- `fileExtension` — the extension without the leading dot.
- `fileSize` — a **human-readable string** such as `938 B`, `1.24 MB`, not a number.
- `filePath` — the file's path **relative to the execution files directory**, using forward slashes.

The file contents are attached as binary data under the name given by **Binary Property**. Each output item carries only its own file's binary; binary from the input item is not forwarded.

Reference a file downstream by expression, e.g. `{{ $json.filePath }}`.

## Usage Examples

- Read all PDF files from an uploads directory
- Load all images matching \*.jpg from a folder
- Import all CSV files in a reports directory for processing
- Read all files recursively from a nested directory structure

## Example Configuration

Read every PDF whose name starts with a year:

```json
{
  "type": "read_binary_files",
  "parameters": {
    "fileSelector": "reports/2024-*.pdf",
    "binaryPropertyName": "data",
    "maxConcurrency": 5
  }
}
```

Read every CSV in a directory tree:

```json
{
  "type": "read_binary_files",
  "parameters": {
    "fileSelector": "data/**/*.csv",
    "binaryPropertyName": "csvFile",
    "maxConcurrency": 3
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Read multiple files matching a glob pattern from the execution files directory into binary data items — one output item per matched file.

### Behavior notes

- **The pattern is read once, from the node, not per item.** Wiring several items into this node does not read the files several times, and it does not let each item supply its own pattern. To read a different set of files per item, use Read/Write Files from Disk instead.
- **Paths are relative and sandboxed.** File resolution is restricted to the execution files directory. Patterns that try to climb out of it with `../` are rejected, and absolute paths are not permitted. Symbolic links are not followed.
- **Dotfiles are skipped.** Files whose name starts with a dot are not matched, even by `*`.
- **Lower Max Concurrency for large files.** Every matched file is read into memory before being stored, so reading many large files at once is the main memory pressure this node creates.