mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-28 01:48:44 +07:00
26 lines
534 B
Markdown
26 lines
534 B
Markdown
---
|
|
contentType: howto
|
|
---
|
|
|
|
# Split binary file data into individual items
|
|
|
|
If you receive more than one binary file from a node, you can split the binary data into individual items using the following code snippet.
|
|
|
|
```js
|
|
let results = [];
|
|
|
|
for (item of items) {
|
|
for (key of Object.keys(item.binary)) {
|
|
results.push({
|
|
json: {
|
|
fileName: item.binary[key].fileName
|
|
},
|
|
binary: {
|
|
data: item.binary[key],
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
return results;
|
|
``` |