FTP download folder

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 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.

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?

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.

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.

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 :smile:.

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

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.

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?

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