node-ftp-client
node-ftp-client copied to clipboard
download seems to skip first file
Hello,
I'm having an issue where if I do a download on a remote directory with only 1 file, it seems to think there are no files in the directory. I'm assuming this is a difference between my FTP server and the one you may have used to test with.
These lines appear to be the culprit:
lib/client.js 279: if (list && list.length > 1) { 280: _.each(list.splice(1, list.length - 1), function (file) {
I found the solution .. just replace this lib/client.js 279: if (list && list.length > 1) { 280: _.each(list.splice(1, list.length - 1), function (file) {
with
if (list && list.length > 0) { _.each(list.splice(0, list.length), function (file) {
actually the splice function was used wrongly.
When i get the next version with fixed above issues.
Fixed on my fork https://github.com/rahman95/node-ftp-client
I am had the same issue. So, I changed client.js line 280
_.each(list.splice(1, list.length-1), function (file) ...
with
_.each(list.splice(0, list.length), function (file)...
this fixed my issue.
Fixed on my fork https://github.com/rahman95/node-ftp-client
Thank you so much