Writing files outside installation directory

Describe the issue/error/question

I would like to download a file from my Dropbox account (onto my Raspberry Pi where I have installed n8n) and save that file to a directory outside the n8n directory, higher up in fact, in another folder. The Write Binary File option seems to only save to the n8n directory.

What is the error message (if any)?


Please share the workflow

Share the output returned by the last node

The whole thing works fine; it downloads the .db file from Dropbox and I can see it in /var/www/n8n/, I just want to save it to /etc/[something]/[something] instead. The only way I can think to take care of this would be an additional application to move the local file after n8n has downloaded it, but I’d like to do everything within n8n if I can.

Information on your n8n setup

  • n8n version: 0.203.1
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]: not sure what this means
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm/Yunohost

Not sure I understand. What happens if you try to write it to a different folder?

If you use an absolute path, and if n8n runs with a user that has permission to write to that folder, it can write anywhere you tell it to.

I get a permission denied error when trying to write to a location specified by the full path outside the n8n directory.

That means the user you are right n8n with does not have the required permissions. So you either run n8n with a user that has, you give the existing user the appropriate permissions or you change the permissions of the folder you want to write to.

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