# FTP Download - Downloads Repeatedly

**URL:** <https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876>\
**Category:** General\
**Created:** [17 November 2021 09:54 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876 "2021-11-17T09:54:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichdeCrep](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richdecrep/32/48088_2.png) [@RichdeCrep](https://discourse.nodered.org/u/RichdeCrep)\
**Post date:** [17 November 2021 09:54 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/1 "2021-11-17T09:54:35Z")

</div>

Hello, may I ask for someone to help me please.

I am trying to FTP download a file from a server, using the "node-red-contrib-ftp-download" node.

The file downloads, but it downloads many (continuously) times until the reports an error.

Here is my code.

Any reason why it does not download only one time? Is there a better node to use?

Thank you in advance

[{"id":"a94e2078d9197b3d","type":"inject","z":"2ddcf8fe.bd73c8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":90,"y":2360,"wires":[["649943a096fc48a1"]]},{"id":"649943a096fc48a1","type":"ftp-download","z":"2ddcf8fe.bd73c8","server":"f7ed700bee3c9a12","files":"/anon/gen/fwo/IDN60004.html","directory":"BOM","name":"","output":"payload","filesType":"str","directoryType":"str","x":280,"y":2360,"wires":[["c703b06d013387a7"]]},{"id":"c703b06d013387a7","type":"file in","z":"2ddcf8fe.bd73c8","name":"","filename":"BOM/IDN60004.html","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":200,"y":2420,"wires":[["c2f4d5bcb3a18d2c"]]},{"id":"c2f4d5bcb3a18d2c","type":"debug","z":"2ddcf8fe.bd73c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":410,"y":2420,"wires":},{"id":"f7ed700bee3c9a12","type":"ftp-download-server","host":"ftp2.bom.gov.au","port":"21","user":"","connTimeout":"10000","pasvTimeout":"10000","keepalive":"10000","name":""}]

---

<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:** [17 November 2021 10:37 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/2 "2021-11-17T10:37:30Z")

</div>

Welcome to the forum @RichdeCrep

In order to make code more readable and importable it is important to surround your code with three backticks  
`````  
`like this`  
`````

You can edit and correct your post by clicking the pencil icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [17 November 2021 10:52 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/3 "2021-11-17T10:52:05Z")

</div>

Please add a Catch node linked to the FTP node to make sure it is not failing and automatically re-trying. Also add a debug node showing what is coming out of the FTP node.

If that doesn't help, please stop node-red then start it again, in a terminal, and post the full output here please, including anything you see when you click the inject node. When posting please use the same technique as for posting flows, so the forum does not mess with it.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 November 2021 12:19 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/4 "2021-11-17T12:19:17Z")

</div>

That node ([node-red-contrib-ftp-download](https://github.com/teastman/node-red-contrib-ftp-download)) hasn't been updated since October 2017 and there are some [issues](https://github.com/teastman/node-red-contrib-ftp-download/issues) with it. You might want to look at one of the other FTP nodes.

Why do you have a `file-in` node right after the FTP node?

---

<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:** [17 November 2021 12:24 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/5 "2021-11-17T12:24:02Z")

</div>

The node downloads to a file, it doesn't send it in the payload. To access the contents it is necessary to read it in.  
The node does work as expected for me.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 November 2021 13:08 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/6 "2021-11-17T13:08:26Z")

</div>

@RichdeCrep what is the error you see and put a `debug` node on the output of the `ftp` node and see what it shows. If more than one msg comes out, the `file-in` node will run each time.

---

<div class="post-metadata">

**Author:** ![RichdeCrep](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richdecrep/32/48088_2.png) [@RichdeCrep](https://discourse.nodered.org/u/RichdeCrep)\
**Post date:** [21 November 2021 18:05 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/7 "2021-11-21T18:05:18Z")

</div>

Hi all,

Thanks for your help. Thanks also for guidance on the ``` when submitting code.

I was drawn away for a few days and revisited it and fixed it today.

1. I was also concerned that the Node was old, and I now suspect that it has errors. So I do not recommend "node-red-contrib-ftp-download".

2. That node was reporting intenal errors, that I thought was my fault. The Catch node produced no joy.

3. I installed an alternate FTP node called "node-red-contrib-ftp-sftp" .  
THIS FIXED THE PROBLEM

Thanks again to all who contributed to fix my problems.

Rich

---

<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:** [5 December 2021 18:05 UTC](https://discourse.nodered.org/t/ftp-download-downloads-repeatedly/53876/8 "2021-12-05T18:05:46Z")

</div>

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