Write binary file node not resolving expressions

I have a “Write binary file” node that takes files from previous node “Extract files” and should save each file into a directory. The path (windows share) is hardcoded and the file name is provided as a javascript code.
The code is properly resolved into a correct filename when setting up the parameters. But when executing the node, the code in {{ }} is used for the filename.
The file itself is written correctly, and into correct directory.

Here is the node setup, with correct filename.

And the saved file, with incorrect filename

Information on your n8n setup

  • n8n version: 1.12.0 and 1.11.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows Server 2012R2

Hey @matus,

Interestingly for me this has worked as expected :thinking:

Do you have a small workflow that can reproduce this issue? Do you get the same issue if you don’t write to a UNC path? It could also be a general Windows issue I will need to find a Windows machine to test on.

Hi Jon,
I did more tests and at the end found a solution - changing from backslash to forward slash did the trick => //path/to/the/{{ $file }}

Still, it is strange that the preview calculates correct path + filename, but the execution does not.

1 Like

Hey @matus,

The front end expression display can be misleading, in this case I suspect the \ is escaping so you would need to double them up.

This is something we should probably fix.

1 Like

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