Node Variables dont work

Hello everyone in the N8N community, I’m new to the tool but I’ve already completed several courses, and I’m having difficulty saving files using the “Read/Write Files from Disk” node.

See, I have several image files (data) and I want each one to be saved in a certain folder with different names.

The problem is that for some reason the files are overwritten one over the other and I don’t know what could be wrong.

Here is the image of my current node.

1 - First node (HTTP Response)

2 - Transform DATA to BASE64

3 - Transform BASE64 to FILE (with filename string)

4 - Save All files

Record Screen
https://gifyu.com/image/b2FbF

Thanks for All

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Captura de tela 2025-02-08 165658

  • 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 2019

The filename path separator on windows (backslash - ) is at odds with the escape character in JS strings. The first thing I would try is changing the backslashes in your output filename to forward-slashes (which, iirc, just “works anyway”)
C:/Users/Administrator/Documents/n8n/{{ $('Extract from file').item.json.id }}.jpeg
If that doesn’t fix it, see if something in this guide, like doubling/escaping the backslash characters in the JS filename string, helps.

One other option, assuming it actually is a filename-string issue, if you can run Docker on the Windows machine, is to run n8n as a container instead of npm and map the Windows filesystem path, as a volume, into a Linux filesystem path in the container. That would handle the filename translations for you, among other advantages of running in Docker.

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