How to reference a file from “Convert to File” node after two nodes?

Hi everyone,

I’m working on a workflow where I receive a Base64-encoded image, convert it to a file using the “Move Base64 String to File” node (which I named “Foto”), and then process it with OpenAI before uploading it via FTP.

The problem is:

The problem is that in the FTP node, I don’t know how to reference the binary data generated in the “Foto” node (which converts a Base64 string to a file).

I tried using {{$node[“Foto”].binary.data}}, but it doesn’t work — the file is either missing or not recognized by the FTP node.

I suspect something is going wrong in the steps between, but I’m not sure how to persist or correctly reference the binary data across nodes.

Any ideas on how to properly reference or preserve the binary file from a previous node?

Information on your n8n setup

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

Hey @fagnerguima - you should be able to drop in this code node and reference your node in there to get proper binary data to work with again.

1 Like

Same problem. The Code node results in a data object and i can’t get this in the ftp node.

No i meant to add it right in front of the FTP node you need the binary 1 step before it.

2 Likes

It is actually recommended to use this helper instead of raw fetching of the file objects:

As described here:

You should always use the getBinaryDataBuffer() function, and avoid using older methods of directly accessing the buffer, such as targeting it with expressions like items[0].binary.data.data .

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.