noodny / node-ftp-client

MIT License
64 stars 32 forks source link

download seems to skip first file #3

Open jasonhillier opened 9 years ago

jasonhillier commented 9 years ago

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) {

piysingh commented 8 years ago

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.

smjservertest commented 7 years ago

When i get the next version with fixed above issues.

rahman95 commented 7 years ago

Fixed on my fork https://github.com/rahman95/node-ftp-client

neelshah23 commented 7 years ago

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.

rspacecode commented 4 years ago

Fixed on my fork https://github.com/rahman95/node-ftp-client

Thank you so much