ibrod83 / nodejs-file-downloader

129 stars 23 forks source link

Percentage progress NaN when downloading url without extension #30

Closed ihm-tswow closed 2 years ago

ihm-tswow commented 2 years ago

Version: 4.9.2

Downloading files without an extension causes onProgress percentage progress to become NaN. The download itself seems to work fine.

async main() {
    await new Downloader(
        {
              url: "https://www.google.com/"
            , fileName: "google.html"
            , onProgress: (perc)=>{
                console.log("% ", perc);
            }
        }
    ).download();
}
main();

Gives output:

%  NaN
%  NaN
%  NaN
%  NaN
%  NaN
%  NaN
%  NaN
%  NaN
%  NaN
ihm-tswow commented 2 years ago

Didn't look at closed issues, nevermind this.

duplicate of https://github.com/ibrod83/nodejs-file-downloader/issues/4