patrickjuchli / basic-ftp

FTP client for Node.js, supports FTPS over TLS, passive mode over IPv6, async/await, and Typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How is it possible to have the total bytes of the file in trackProgress() callback ?

top-kat opened this issue · comments

Hi, firstly thanks for such a great lib <3

It could be useful to add the total file size in the trackProgress callback param. Has I have seen in the code, it is not there for the moment.

I immagine something like:

client.trackProgress(info => {
      console.log(`Downloading: ${info.bytes}/${info.totalForActualFile}`)
});

May that be possible ? If not, how can I get this data for a particular file on ftp server ?

Thanks for your help :)

There is not always a file, you can also upload data from a stream where there is no inherent size.

There are not plans at the moment to support this.