# FTP download folder

**URL:** https://discourse.nodered.org/t/ftp-download-folder/6381
**Category:** General
**Created:** [4 January 2019 11:59 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381 "2019-01-04T11:59:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Martin](https://discourse.nodered.org/u/Martin)
#### Post date: [4 January 2019 11:59 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/1 "2019-01-04T11:59:32Z")

</div>

Hello readers. for a proyect i need to download a folder from a FTP server. the only node what allows something close to what i need, is this one [https://flows.nodered.org/node/node-red-contrib-ftp](https://flows.nodered.org/node/node-red-contrib-ftp) Does anyone knows how can i do for download a full folder?. i have been trying a lot stuff, but this module requires the full path incluying the file name, so it can not download any folder. Thanks for any advice.

Regards  
Martín.

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [4 January 2019 12:06 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/2 "2019-01-04T12:06:13Z")

</div>

I don't think the ftp protocol itself supports a directory download option. So any ftp clients that do it are getting a listing recursively and downloading files one by one automatically.

Can't you list the files and then recursively download them one at a time?

---

<div class="post-metadata">

### Author: ![Martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Martin](https://discourse.nodered.org/u/Martin)
#### Post date: [4 January 2019 12:11 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/3 "2019-01-04T12:11:38Z")

</div>

Thanks for your reply ukmoose, yes i can, but this data is generated every 1 hour 24/7, so it means that its required to download a lot of files per day and week. i thought if i could download a folder it might be more faster.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [4 January 2019 12:22 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/4 "2019-01-04T12:22:40Z")

</div>

You may want to look at something like the **lftp** command line tool. As that can handle directories - and then call it via an exec node for example.

---

<div class="post-metadata">

### Author: ![Martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Martin](https://discourse.nodered.org/u/Martin)
#### Post date: [4 January 2019 12:39 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/5 "2019-01-04T12:39:08Z")

</div>

Thanks for your reply dceejay. i have never listen lftp before, as i can see at google it is exactly what i needed. thanks so much for your advice 😄.

---

<div class="post-metadata">

### Author: ![keisi](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@keisi](https://discourse.nodered.org/u/keisi)
#### Post date: [14 February 2020 13:09 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/6 "2020-02-14T13:09:50Z")

</div>

> [@ukmoose](#):
>
> Can't you list the files and then recursively download them one at a time?

Hi everybody, I'm new in Node-Red and I'm interested in listing file from a folder a send them one at a time via ftp?  
Does anyone can help me with an example?

Regards

---

<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: [14 February 2020 13:21 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/7 "2020-02-14T13:21:01Z")

</div>

You can use `node-red-contrib-fs` or `node-red-contrib-fs-ops` to list files in a directory.

First thing to do is install one of them and then play with it. add an `inject` and `debug` node and see how they work.

Next create another flow and play with the `FTP` node and make sure you can send one file to the location you want.

Then, when you get to the point where both of those things work, you are 90% of the way. Just send each file you get from the first flow thru the second flow.

You could also add in the `watch` node to see when the foledr you are looking at changes.

---

<div class="post-metadata">

### Author: ![keisi](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@keisi](https://discourse.nodered.org/u/keisi)
#### Post date: [14 February 2020 14:42 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/8 "2020-02-14T14:42:41Z")

</div>

> [@zenofmud](#):
>
> Just send each file you get from the first flow thru the second flow.

Thank you zenofmud, I tried with fs-ops list and I get an array of all the files in a folder. FTP connection is ok, but what is missing, and I so not have clear in my mind, is:  
how can I reiterate the task in order to use all the file in the folder? Or better, how can I parse the file names from the array and send them separately to the ftp node as msg.localfilename?

---

<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: [14 February 2020 16:35 UTC](https://discourse.nodered.org/t/ftp-download-folder/6381/9 "2020-02-14T16:35:37Z")

</div>

If you look at node-red-contrib-fs you can get each file as a separate msg or one msg with an array of all the files
