Open 277584579 opened 5 months ago
Hello @277584579 , this is a correct behavior, this can be for many reasons, you could be using a pipe that is doing compression for example, you could be using a pipe to transform the data resulting in a different filesize , or you hard disk has compression enabled too, but if you look at totalSize
and downloadedSize
the values matches, the library doesnt rely on onDiskSize
because of the previous mentioned
But when I downloaded it and decompressed it, it showed that some files were damaged. How should I solve this problem? This is an occasional issue, not a mandatory occurrence The same zip file, when I download it again and it displays as shown in the following picture, it is normal, The onDiskSize displayed twice is different
const downloader = new DownloaderHelper( fileURL, filePath, options = { fileName: fileNameTmp, resumeIfFileExists: true, timeout:5000, removeOnStop:false, removeOnFail:false, retry:{ maxRetries:6, delay:5000 }, resumeOnIncomplete:true, resumeOnIncompleteMaxRetry:50 } ); downloader.start() downloader.on('end', (stats) => { console.log(stats) }) I saw under the "end" callback that incomplete is false, but the size of onDiskSize and downloadedSize are different