-
Notifications
You must be signed in to change notification settings - Fork 44
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
Corrupted file downloads #1
Comments
Hello, Sorry for the delay, I was quite busy with huge projects the past weeks. I encountered this error too, but with a bigger file (1Gb), and have not found a solution for now to this. On my program, I currently restart the download if the file is corrupted. This is not ideal, especially with a big file, but this is the only workaround I've found for now. Maybe this is coming from the main library "mt-downloader", but I'm not sure. Does this append when the download/app crash and you try to resume the download, or when you stop the download and then try to resume it ? Do you have found any new informations on this ? |
This is actually very easy to reproduce. Run the examples You will see |
possibly this issue in I am going to try use the latest version of |
I was able to fix this on windows, by updating the change is how the file mode is set
becomes
because I am using this library on a legacy project, which doesn't actually use a package.json to manage the dependencies, and rather they are checked into source control, we just documented this change on our side. that solution is not ideal, but it works in our scenario |
Thanks for your informations. I will try to update to the latest mt-downloader version as soon as possible, maybe this will fix the problem. You can follow the progress here if you're interested: #5 |
i have same issue, and i can confirm that the solution from @shainegordon works great, changing but is not ideal to change manually this file from mt-downloader on the node_modules but this approach worked only with some files, another ones that were ok before now are corrupted |
Could you please help me trace the issue:
If I download a file without resuming in any way, it works pretty much 100%
However, the moment the file is resumed, its luck of the draw with most of the time the file throwing an error
The first time I received this error:
DEMO - Resuming download...
EVENT - Download 1 error !
[Error: Invalid file path: c:/test/10MBtest.bin.mtd]
Download 1 error : Error: Invalid file path: c:/test/10MBtest.bin.mtd
The file was there, don't know why it was locked out.
The second time is the main issue I am facing:
EVENT - Download 1 error !
{ [Error: EPERM, ftruncate] errno: -4048, code: 'EPERM' }
Download 1 error : Error: EPERM, ftruncate
The file can balloon from 4-20 x its original size.
Here's my test code, the file name can be set to 100MBtest.bin if your speed is to fast to receive the issue:
The only other changes I made to your base code is to set the default threads to 6. I had them at 16 but found it replicated at lower numbers as well.
The text was updated successfully, but these errors were encountered: