sergi/jsftp

Ftp.get(remotePath, localPath, callback) creating files with size 0

Opened this issue · 0 comments

get function creating files with size 0 and nothing else happens.
code:

let ftp = new JsFtp({
    host: settings.host,
    port: settings.port,
    user: settings.user,
    pass: settings.pass,
    debug: console.log,
    debugMode: true,
});

ftp.get('/popup_flag.txt', './popup_flag.txt', function (err) {
    if (err) {
        console.error('ftp.get failed.', err);
        return;
    }
    console.log('-', 'downloaded', 'downloaded successfully');
});

I could not get any logs of by running this code, ./popup_flag.txt file is created but it is empty.

NodeJS: v12.16.3
OS: Windows 10

this my might be related to #284 and #285

tried using another library basic-ftp which worked. I guess it is NodeJS version issue.