# Not able to create file into SFTP folder

**URL:** <https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256>\
**Category:** General\
**Created:** [15 December 2022 13:44 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256 "2022-12-15T13:44:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManelBha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/manelbha/32/72636_2.png) [@ManelBha](https://discourse.nodered.org/u/ManelBha)\
**Post date:** [15 December 2022 13:44 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/1 "2022-12-15T13:44:23Z")

</div>

HI All,  
I have installed "node-red-contrib-better-sftp" into my node red and using this am trying to create the file with the content into the SF

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b6b805b7022d53d9bdef103cf3c03f7897113792.jpeg)  
TP folder.  
i have done the configuration but i don't able to create the file into my specified folder .  
Please help me to resolve this problem  
\*\*  
 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b6b805b7022d53d9bdef103cf3c03f7897113792.jpeg)

 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49d58f938dbd38f8d6d6a7ded34455ce3f1038dc.jpeg)  
 ![33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d78d765be9f67b48aa323761d44f899d415f709.jpeg)  
 ![4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec4cf9bb55c5ecd8aaf24671da4edf7f5eb294f7.jpeg)  
 ![5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52067c50b91fdd776562fcbd642374e79fa366ff.jpeg)  
 ![6](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/73bbac25fd79d84247cc9c4c9e31aafe6449733a.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 December 2022 14:01 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/2 "2022-12-15T14:01:11Z")

</div>

I haven't used that node, but always, when you have trouble with a node, the first thing to do is to look at the data you are sending to it. Feed the message that is going into the sftp node into a debug node and show us what is there. That is more important initially than showing us the code in your function.

**[Edit]** In the node you don't seem to be setting a working directory. Also I would advise against using `./` at the front of the file path. There is no need.

**[More Edits]** It may not be valid to specify a path for the remote file, it may be that only a file name is allowed. Try that first to get it working.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 December 2022 14:12 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/3 "2022-12-15T14:12:50Z")

</div>

Also, if you look at the [issues against the node](https://github.com/sublime93/node-red-contrib-better-sftp/issues) you will see that none have been answered for a long time, and several of those issues are serious. The conclusion is that the node has been abandoned. You may have to find an alternative way of doing it.

---

<div class="post-metadata">

**Author:** ![ManelBha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/manelbha/32/72636_2.png) [@ManelBha](https://discourse.nodered.org/u/ManelBha)\
**Post date:** [15 December 2022 14:53 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/4 "2022-12-15T14:53:43Z")

</div>

thanks Colin ,

the result of each debug

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a7557324d353dd396cb112820e1dd1b444e230ce.png)

no result for 'debug 40'

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 December 2022 15:05 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/5 "2022-12-15T15:05:32Z")

</div>

How have you configured the node and what error is it showing now?

The readme says that msg.payload.data should be a filename or buffer, not a string ("errors")

---

<div class="post-metadata">

**Author:** ![ManelBha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/manelbha/32/72636_2.png) [@ManelBha](https://discourse.nodered.org/u/ManelBha)\
**Post date:** [15 December 2022 15:45 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/6 "2022-12-15T15:45:45Z")

</div>

I did not do any configuration ; except that I put the name of host d node SFTP , the user , port and the pwd,

I want to take the content of file "/input/text file.csv" and create a new file called "testErrorsfile" with the same content under errors folder.

![a](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/54411edc1e15b0f66833680beac0dcf3ca58c36e.jpeg)

 ![b](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc673e388f1226105063e511e63ecc920abb4304.jpeg)

---

<div class="post-metadata">

**Author:** ![ManelBha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/manelbha/32/72636_2.png) [@ManelBha](https://discourse.nodered.org/u/ManelBha)\
**Post date:** [15 December 2022 15:54 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/7 "2022-12-15T15:54:30Z")

</div>

error : node red crush

 ![c](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/067a1f5db9c2ce7d8fe1eac84ef82281d4bb22ff.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 December 2022 16:01 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/8 "2022-12-15T16:01:01Z")

</div>

As I already said, it is not clear that you can specify the folder with the filename. At least for the moment, to see if the node works at all, put the folder in the node configuration and just feed the filename and data in. Look in the help text for where they have to go and check you have it right. There is no point posting screenshots of flows, code or errors until you have got the data in the debug node matching what the node asks for.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 February 2023 16:01 UTC](https://discourse.nodered.org/t/not-able-to-create-file-into-sftp-folder/72256/9 "2023-02-13T16:01:23Z")

</div>

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