I am getting the error: “Access to the file is not allowed Allowed paths: C:\Users\Saravanan/.n8n-files**”**, while using Read/Write Files from Disk node.
Configured File(s) Selector parameter(Read\write from disk node): C:\Saran\AI\AI_ProfileScreen
echo %N8N_ALLOWED_FILE_PATHS% → C:\Users\YourName\Documents\pdfs;C:\Saran\AI\AI_ProfileScreen
The file is available in: C:\Saran\AI\AI_ProfileScreen\Aditiya_Developer_P3.pdf
Installed Environment: N8N installed in local using npm setup,
Not able to resolve this error
Windows uses backslashes (\), but n8n (built on Node.js) interprets backslashes as escape characters unless they are doubled or flipped. Change your path definition to use forward slashes instead.
Let me know if this works, if it doesn’t, I have a few more solutions that might work.
Hi @Saravanan_Nagarajan1
The main problem is that n8n is ignoring the folder permissions you set. Even though you can see the correct path when you type a command in your terminal, the n8n program itself is still using its own default restricted folder. This is why you are getting an “Access not allowed” error.
This usually happens because of how Windows handles “environment variables.” When you change a setting like this, any program already running doesn’t notice the change. If n8n was already open, or if the setting was only applied to one specific window, n8n continues to act as if the permission doesn’t exist.
To fix this permanently, you should add the folder path to your Windows System Environment Variables. By doing this through the Windows Control Panel instead of just the command line, you ensure that every time n8n starts up, it knows exactly which folders it is allowed to access.
If you want to test it quickly without changing system settings, you can force n8n to start with the permission active. You do this by typing a specific “set” command in your terminal immediately before typing the command to start n8n. This tells the program, “For this specific session, use these allowed paths.”
For Command Prompt (cmd):
set N8N_ALLOWED_FILE_PATHS=C:\Saran\AI\AI_ProfileScreen && n8n start
For PowerShell:
$env:N8N_ALLOWED_FILE_PATHS="C:\Saran\AI\AI_ProfileScreen"; n8n start
Once you have applied either the permanent or quick fix, the most important final step is to completely close all your terminal windows and restart n8n. Once you restart, the error should disappear, and n8n will be able to read your PDF file from the AI_ProfileScreen folder.
I found the fix for the solution; I have set the N8N_RESTRICT_FILE_ACCESS_TO environment variable to the desired path and it is working now. Thank you all for the support