-
Notifications
You must be signed in to change notification settings - Fork 90
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
Stop a download #33
Comments
There is no easy way to do this as of now. The only way you can do it is as follows - var mtd = require('mt-downloader');
var url = 'https://upload.wikimedia.org/wikipedia/commons/4/47/Gadget_the_pug_expressive_eyes.jpg';
var file = './Gadget_the_pug_expressive_eyes.jpg';
var downloader = new mtd(file, url, {
onStart: function (data) {
data.threads.each(function(i){
i.destroy();
});
}
});
downloader.start(); I hope this helps. I would be glad to merge a pull request which would make it easier. |
It seems quite easy, just what I needed. |
Is it safe to just destroy the threads? I implemented your proposal and sometimes I get a corrupted mtd file, which cannot be resumed. |
I think you should send a destroy event to the thread Sent from Mail.Ru app for iOS Thursday 14 January 2016 18:24 +0300 from notifications@github.com notifications@github.com:
|
Yes, that's what I do. But my question is if it is safe do to so? Because sometimes I get corrupted mtd file, which can not be resumed... |
Hi,
Thanks for your module, it's very usefull and working great !
Is there an easy way to stop (cancel) a download ?
The text was updated successfully, but these errors were encountered: