Follow up on Is it really not possible to get files from a smb file share?

Hello Alexey, sorry for the late response!

I was writing this in the original topic, but was called away. When I returned the topic was closed and I couldn’t save my response…

Option 1: I tried it, but can’t get it to work. I’ve tried setting N8N_FILESYSTEM_ALLOWED_PATHS in different ways, but in never seems to work. I always get Access to the file is not allowed. Allowed paths: C:\Users\yyyyyy/.n8n-files

I’ve tried:

  • C:\Users\yyyyyy\.n8n\.env
  • C:\Users\yyyyyyy\AppData\Roaming\npm\.env
  • as Windows environment variable under User and System
  • as powershell variable with
    • [System.Environment]::SetEnvironmentVariable(‘N8N_FILESYSTEM_ALLOWED_PATHS’,‘D:_Install’, ‘user’) (with user and machine)
    • $env:N8N_FILESYSTEM_ALLOWED_PATHS = “d:_Install”

I followed this post:

Option 2 is not a suitable option, unless we user multiple n8n instances, we have way to many shares to mount them all.

Solution 3 definitely works in my tests, but I prefer options 1 and 4 if I can get them to work.

Option 4: I can’t get that and simular community nodes to work. As my knowledge of docker is very limited it’s propably my fault.

As a health care organization we have very strict security rules. I don’t know yet what method we can use. I’ve set up n8n on 3 servers:

  • Linux + Docker
  • Windows + Docker
  • Windows + npm

Hi @BVE

Open a fresh PowerShell window. Run this exact command (notice the added backslash): $env:N8N_FILESYSTEM_ALLOWED_PATHS="D:\_Install"
In that exact same window,
type n8n start and hit Enter. To make it permanent, add N8N_FILESYSTEM_ALLOWED_PATHS with the value D:\_Install into your Windows System Environment Variables GUI and completely reboot your PC.

hello @A_A4 ,

the missing \ was a typo :slight_smile: I’ve copied $env:N8N_FILESYSTEM_ALLOWED_PATHS from a powershell session, but typed the path in the browser and missed the backslash…

The backslash was used in every test I did.

because this is a seperate topic, these were the options:

Option 1: Set N8N_FILESYSTEM_ALLOWED_PATHS (Windows npm install)

Option 2: Docker with volume mounts

Option 3: Execute Command node (most flexible for 1400+ servers)

Option 4: Community node n8n-nodes-smbclient

since Option 3 works, you might just want to stick with that. Using standard CLI commands is generally the most stable way to juggle 1400+ network shares dynamically without overloading the n8n UI.

1 Like

I’ve got it working with UNC paths :slight_smile:

What I did:

  • run N8N in NPM on a Windows 2022 server

  • Run N8N as a service using AlwaysUp

  • set system variables:

    • N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
    • N8N_RESTRICT_FILE_ACCESS_TO=“”
    • N8N_SECURE_COOKIE=false
    • NODES_EXCLUDE=[ ]
      (spaces between brackets, without the space in was converted into a square image after saving on the forum)
  • created new workflow with:

So every \ needs to be a /

I can read, write and copy files on network shares, execute Powershell scripts an commands, access SQL Server databases, so almost everything I wanted to do :smile:

Hi @BVE
That’s great news! Please mark the reply that helped you most as the solution so it can help other community members and supporters.