Is it possible to kill/stop a network.download() ?

Is it possible to kill or stop a download when using network.download()?

We have a function that starts the download of a large video and want to allow the users to cancel out of downloading at any time.

We are using the listener to do something if the download finishes, but have found that if you suspend and resume the app, the downloaded file does not work but the listener still triggers as if it finished correctly. So I would like to allow the user to kill the download or program it to kill the download on app suspend.

network.download( url, method, listener [, params], destFilename [, baseDir] )  

I need to be able to kill the download at any time and for it to stop downloading immediately.

Any suggestions? [import]uid: 7845 topic_id: 12596 reply_id: 312596[/import]

Hi a3mg!

You posted this long time ago but I’m trying to solve the same question.
Did you solved it?

TIA
Alberto. [import]uid: 44013 topic_id: 12596 reply_id: 142626[/import]

No, was never able to stop or kill the download. Have not looked in a while to see if any changes have been made to incorporate this though. [import]uid: 7845 topic_id: 12596 reply_id: 142648[/import]

Hi a3mg!

You posted this long time ago but I’m trying to solve the same question.
Did you solved it?

TIA
Alberto. [import]uid: 44013 topic_id: 12596 reply_id: 142626[/import]

No, was never able to stop or kill the download. Have not looked in a while to see if any changes have been made to incorporate this though. [import]uid: 7845 topic_id: 12596 reply_id: 142648[/import]

@a3mq

Not sure if this is what you had been looking for, but is this helpful?

http://docs.coronalabs.com/api/library/network/cancel.html

@a3mq

Not sure if this is what you had been looking for, but is this helpful?

http://docs.coronalabs.com/api/library/network/cancel.html