Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download completed, file incomplete #118

Open
277584579 opened this issue Jun 4, 2024 · 2 comments
Open

Download completed, file incomplete #118

277584579 opened this issue Jun 4, 2024 · 2 comments

Comments

@277584579
Copy link

277584579 commented Jun 4, 2024

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)
})
image
I saw under the "end" callback that incomplete is false, but the size of onDiskSize and downloadedSize are different

@hgouveia
Copy link
Owner

hgouveia commented Jun 4, 2024

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

@277584579
Copy link
Author

277584579 commented Jun 5, 2024

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
image
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
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants