# Couldn't write binary data to file by using write file from desk node

**URL:** <https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717>\
**Category:** Questions\
**Created:** [March 13, 2026, 10:24am UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717 "2026-03-13T10:24:15Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 10:24am UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/1 "2026-03-13T10:24:16Z")

</div>

![image](https://europe1.discourse-cdn.com/n8n/original/3X/7/0/70439518ef6d6e9ca6c7a2f7f099f13988087fa4.png)my requirement is list the files from sftp and download the sftp files from SFTP. Below i have attached the my workflow. file will be save as binary in FTP download node so i have used write file from desk node for write the binary data to file and while executing the workflow it always shows error of not writable. below i have attached the write file from desk screenshot and error screenshot So please give me the solution.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/6/b/6b8e62e26427c0fe1aaa1b31ccffd530e311e200.jpeg)

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/f/1f005d8098cfa60851623e8f2a5919ba4cc18177.png)

---

<div class="post-metadata">

**Author:** ![Mookie\_Lian](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mookie_lian/32/100252_2.png) [@Mookie\_Lian](https://community.n8n.io/u/Mookie_Lian)\
**Post date:** [March 13, 2026, 10:36am UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/2 "2026-03-13T10:36:55Z")

</div>

@Kaviya_V How did you deploy n8n? If using Docker, you have to add a mount and give the container access to `D:\N8n\files`. Make sure to give the container permissions on this directory(`sudo chown -R 1000:1000 /host/path` on Linux), otherwise it will also fail with the same error.

---

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 10:45am UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/3 "2026-03-13T10:45:13Z")

</div>

Hi, i Insatlled the n8n locally hosted not from docker

---

<div class="post-metadata">

**Author:** ![Mookie\_Lian](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mookie_lian/32/100252_2.png) [@Mookie\_Lian](https://community.n8n.io/u/Mookie_Lian)\
**Post date:** [March 13, 2026, 12:27pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/4 "2026-03-13T12:27:52Z")

</div>

I can’t say what’s the issue in that case. But generally speaking, the npm release is not stable and I don’t recommend using it for production. You would want to move to Docker eventually in the future.

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [March 13, 2026, 12:31pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/5 "2026-03-13T12:31:38Z")

</div>

Hi @Kaviya_V Welcome!  
I guess you should try giving explicit permissions to that path if that works via env variable which is N8N\_RESTRICT\_FILE\_ACCESS\_TO which you can setup in windows using `set` command before running n8n, although i would not agree on NPM version of n8n is not being stable as i am using that only for past 8 months and never faced any issue. Try reading this thread for more information about similar errors:

> [@STUCK in COURSE LEVEL 2 - Read/Write node exercise](http://community.n8n.io/t/stuck-in-course-level-2-read-write-node-exercise/258826):
>
> Describe the problem/error/question Hello folks, I am stuck on the Binary Exercise 2 from the official n8n course level 2. In this particular step where it says “Write the new binary file data to the machine where n8n is running using the Read/Write Files From Disk node.”, I keep getting this erro “Problem in node ‘Read/Write Files from Disk‘ The file “C:\tmp\poetrydb.json” is not writable.” What is the error message (if any)? the error details I see in the output is as follows: { “errorMess…

---

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 2:37pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/6 "2026-03-13T14:37:42Z")

</div>

hi, i set env variable as per you mentioned and n8n start from powershell, it is working but if i closed powershell command prompt, it is again start throws same error. should i keep on open powershell cmd?

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [March 13, 2026, 2:41pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/7 "2026-03-13T14:41:41Z")

</div>

Hi @Kaviya_V Glad it worked, it is a limitation of those env variables that once the session is closed those values would also be gone although you could go inside CMD configs and permanently edit those but i do not recommend that because those values can sometimes change, so for now the best fix is to install n8n via docker and then edit those in its configs that would always be saved and would be up, just in case if you do not want docker and want NPM like me what i did was:

currently you have used `set` command but now use `setx` command that would save everything permanently like setx ENV\_NAME=VALUE

Just in case if you want docker:

> **[Docker | n8n Docs](https://docs.n8n.io/hosting/installation/docker/)**
>
> Documentation for n8n, a workflow automation platform.

---

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 3:00pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/8 "2026-03-13T15:00:10Z")

</div>

> [@Anshul\_Namdev](#):
>
> currently you have used `set` command but now use `setx` command that would save everything permanently like setx ENV\_NAME=VALUE

currently you have used `set` command but now use `setx` command that would save everything permanently like setx ENV\_NAME=VALUE- could you please clearly say?

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [March 13, 2026, 3:03pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/9 "2026-03-13T15:03:46Z")

</div>

> [@Anshul\_Namdev](#):
>
> N8N\_RESTRICT\_FILE\_ACCESS\_TO

I mean here you previously might have used this:

set N8N\_RESTRICT\_FILE\_ACCESS\_TO=/some/file/path

and as you have confirmed this worked, now i want you to try using this:

setx N8N\_RESTRICT\_FILE\_ACCESS\_TO=/some/file/path

And that should permanently save that path so that no matter which session you open this env variable would always be saved across all sessions of CMD and you do not have to re declare again and again when starting n8n via npm command.

---

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 3:31pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/10 "2026-03-13T15:31:44Z")

</div>

sorry, i have used enviroment variable application property for set the path as per screenshot mentioned in forum, So could you please say where should i execute setx N8N\_RESTRICT\_FILE\_ACCESS\_TO=/some/file/path? Power shell or command prompt?

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [March 13, 2026, 3:34pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/11 "2026-03-13T15:34:44Z")

</div>

@Kaviya_V You have to use that command before starting n8n in the COMMAND PROMPT not in power shell. (in the same shell for first run and then test does it work in different sessions or not)

---

<div class="post-metadata">

**Author:** ![Kaviya\_V](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kaviya_v/32/61464_2.png) [@Kaviya\_V](https://community.n8n.io/u/Kaviya_V)\
**Post date:** [March 13, 2026, 4:12pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/12 "2026-03-13T16:12:19Z")

</div>

Hi, i put this commmand in nssm and restart the n8n after that it is working fine. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Anshul\_Namdev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/anshul_namdev/32/178229_2.png) [@Anshul\_Namdev](https://community.n8n.io/u/Anshul_Namdev)\
**Post date:** [March 13, 2026, 4:25pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/13 "2026-03-13T16:25:38Z")

</div>

Hey @Kaviya_V Glad it worked to appreciate my help consider marking that as a solution to let other’s know what is right.

Cheers! Have a nice weekend!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [June 11, 2026, 4:25pm UTC](https://community.n8n.io/t/couldnt-write-binary-data-to-file-by-using-write-file-from-desk-node/276717/14 "2026-06-11T16:25:39Z")

</div>

Closed on June 11, 2026, 4:25pm UTC

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