Multiple binary data access filename

Describe the problem/error/question

I have 2 binary files from the input node and I can’t access the “filename” of one of the binary data.

This expression doesn’t return anything:

{{ $binary[“Featured Image_0”].filename }}

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**1.24.0
  • Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):**own
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**docker
  • Operating system:

Is it possible, that it has no filename in that object?
you can check by looking at the output/preview when you have only $binary[‘your filename’] without the “.filename”)
maybe you need to assign a filename to the binary in an earlier step.
Or if the filename is a property of the item.json, you add it from there.

1 Like

This is exactly it, It looks like the files don’t have a filename set so there is no value to return.

I used this to assign the filenames:

The only problem is that the other json is lost (meaning only the binary is being outputted). So I think I have to use a Merge node? But then again the “duplicate incomplete json” would result

Hey @pooria,

Do you have a screenshot of the error you get after setting a filename?