# Recommend an SFTP node

**URL:** <https://discourse.nodered.org/t/recommend-an-sftp-node/60100>\
**Category:** General\
**Created:** [20 March 2022 10:34 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100 "2022-03-20T10:34:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 March 2022 10:34 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/1 "2022-03-20T10:34:07Z")

</div>

I have a need to upload a file to my website from Node-RED so thought SFTP would be the way to do it.

I notice there's a few STFP nodes - anyone doing this and would recommend one of them?

---

<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:** [20 March 2022 11:08 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/2 "2022-03-20T11:08:53Z")

</div>

Can you use rsync? You could do that via an exec node. The great advantage is that it will sync a complete directory if required, and that it only updates files that it needs to. If you setup ssh keys then you won't need to give it a password.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [20 March 2022 11:10 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/3 "2022-03-20T11:10:45Z")

</div>

Hi Simon - I think I tried all the sFTP nodes and couldn't get any of them to work with my ISP.  
In the end I wrote a Python script and called it from an 'exec' node in Node-RED.  
That worked fine for me.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 March 2022 11:13 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/4 "2022-03-20T11:13:58Z")

</div>

I want to have a file on my webserver called last.txt and I want to be able to update its contents.

So preferably, be able to specify the filename and contents to upload.

But at end of day, I can write the contents to a local copy of last.txt and then just upload it.

I've got node-red-contrib-sftp working doing this but just seeing if someone is using any of the other other contrib nodes that maybe allow the contents of a file to be specified as a msg parameter rather than having to do the file write and then upload

---

<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:** [20 March 2022 11:19 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/5 "2022-03-20T11:19:25Z")

</div>

Using ssh you can, for example, run the command  
`echo 'Some Text' | ssh user@remotehost -T "cat > /path/remotefile.txt"`  
which will write "Some Text" to the file. In fact you should be able to write to the remote file in a similar way direct from stdin, but I would have to work out the command.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 March 2022 11:22 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/6 "2022-03-20T11:22:10Z")

</div>

I've got a working solution - just wanted to see if anyone was actually using any of the sftp nodes as they are sparsely documented 🙂

---

<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:** [20 March 2022 13:38 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/7 "2022-03-20T13:38:01Z")

</div>

> [@cymplecy](#):
>
> I've got a working solution

There is a big difference between a working solution and one that gives you a warm glow when you sit back and see it work, and feel that you have got the _right_ solution. 🙂

---

<div class="post-metadata">

**Author:** ![jmk-randers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmk-randers/32/49562_2.png) [@jmk-randers](https://discourse.nodered.org/u/jmk-randers)\
**Post date:** [29 March 2022 06:56 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/8 "2022-03-29T06:56:16Z")

</div>

All the SFTP nodes seem a bit stale in development atm sadly.

I got [GitHub - sublime93/node-red-contrib-better-sftp](https://github.com/sublime93/node-red-contrib-better-sftp) to work, but like all the other sftp nodes i have found the configuration seems to accept hardcodede values only. I have tried to use ${env} in the input fields to test if the functionality was implemented, but to no avail.

I have raise an issue on github for the node to be improved with the TypedInput Widget, but the repo has not been active for at couple of years..

Anyone up for a quick improvement ? 😃

---

<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:** [28 May 2022 06:56 UTC](https://discourse.nodered.org/t/recommend-an-sftp-node/60100/9 "2022-05-28T06:56:28Z")

</div>

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