# Ionic Deploy how to cancel download in progress

**URL:** <https://forum.ionicframework.com/t/ionic-deploy-how-to-cancel-download-in-progress/30805>\
**Category:** ionic-v1\
**Created:** [August 19, 2015, 6:44pm UTC](https://forum.ionicframework.com/t/ionic-deploy-how-to-cancel-download-in-progress/30805 "2015-08-19T18:44:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffhalhead](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jeffhalhead](https://forum.ionicframework.com/u/jeffhalhead)\
**Post date:** [August 19, 2015, 6:44pm UTC](https://forum.ionicframework.com/t/ionic-deploy-how-to-cancel-download-in-progress/30805/1 "2015-08-19T18:44:18Z")

</div>

Is there currently any way to cancel/stop the $ionicDeploy.download() process? Our app has a fairly large amount of content and I’d like to display a progress bar along with a cancel button while the update is being downloaded to the app.

This cancel feature is required in the case where a user has a slow connection and the download takes a long time. We want to give users the option to back out in this situation.

So far I have not changed the download and extract code from what’s in the docs.

```
        // Download the updates
        $ionicDeploy.download().then(function() {
            // Extract the updates
            $ionicDeploy.extract().then(function() {
                // Load the updated version
                $ionicDeploy.load();
            }, function(error) {
                // Error extracting
            }, function(progress) {
                // Do something with the zip extraction progress
                $scope.extractionProgress = progress;
                console.log('Extraction Progress: ' + $scope.extractionProgress);
            });
        }, function(error) {
            // Error downloading the updates
        }, function(progress) {
            // Do something with the download progress
            $scope.downloadProgress = progress;
            console.log('Download Progress: ' + $scope.downloadProgress);
        });
```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 6, 2015, 7:05pm UTC](https://forum.ionicframework.com/t/ionic-deploy-how-to-cancel-download-in-progress/30805/2 "2015-11-06T19:05:17Z")

</div>

Looking at the code of the JS of ionic-platform-webclient and the JS and native code of the plugin I see no code that could be used to cancel a download. It just starts a download in the background and reports the background back to the callback.

But, I think it wouldn’t actually be too hard for a native developer to add this to the plugin. Probably a call to a function that sets a variable the download progress checks periodically and then just stops downloading. But of course this would need changes in all librariers (ionic-platform-webclient and plugin) - so better talk to the Ionic guys before implementing this, to find out if they actually want to merge this into their code.

Related:  
Did you have any success displaying the process in a progress bar? I’m playing around with this right now, but somehow the values just don’t get updated.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 19, 2015, 2:25am UTC](https://forum.ionicframework.com/t/ionic-deploy-how-to-cancel-download-in-progress/30805/3 "2015-11-19T02:25:38Z")

</div>

D’oh, I could use this function now. Anybody built it yet?
