node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

Uploading a directory?

Open stephen-last opened this issue 7 years ago • 2 comments

I think put(input, destPath, useCompression) seems to be for files only.

I need to upload a directory, including all sub directories and files, and the directory structure will be many levels deep.

Is there a method for uploading a directory that I'm missing in the docs..? I ask because I imagine this is a very common task when FTP'ing.

Or is my only option to write my own recursive function..?

stephen-last avatar Mar 13 '17 11:03 stephen-last

Hi, I'm not part of this project, but by checking the sources it looks like the internal _store uses the fs.createReadStream(input) function in order to read input file, which doesn't allow to read from a directory. Despite this limitation, using your own function may not be that hard, eg. using a helper library such as async could be an efficient solution.

gbourel avatar Mar 14 '17 18:03 gbourel

ftp-deploy work for me

hexianzhi avatar Sep 24 '20 06:09 hexianzhi