capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

Allow cancellation during file download with AbortController

Open muuvmuuv opened this issue 2 years ago • 4 comments

Feature Request

Plugin

  • Filesystem

Description

I would like our users to allow cancelling file downloads. We download a lot of files in batches in a queue and currently the UX is not very good because the running batches of files in background block the WebView rendering in Android. The user must wait for all files in the batch to be download.

Platform(s)

  • iOS
  • Android
  • Web

Preferred Solution

Use AbortController to allow cancellation per Spec.

Compatibility seems to be in your range: https://developer.mozilla.org/en-US/docs/Web/API/AbortController#browser_compatibility

Alternatives

Callback or something.

Additional Context

muuvmuuv avatar Aug 23 '23 09:08 muuvmuuv

This limitation affects user experience significantly. Could someone please take a look at this issue? Also, if possible, could you provide an estimate on when we might expect this feature to be implemented?

Many thanks for your ongoing efforts and support.

DominikTrenz avatar Nov 19 '23 07:11 DominikTrenz

Hey all - we have a scenario where users have no way of cancelling large downloads without closing and opening the app. This is really bad UX.

Is there anything I can do to help move this along? I'm happy to dig into the plugin source if need be.

WoodyWoodsta avatar May 29 '24 14:05 WoodyWoodsta

I'd love to see this too — downloadFile should be cancelable.

https://github.com/ionic-team/capacitor-plugins/tree/main/filesystem#downloadfile

edit: I found a plugin that seems to support, https://github.com/AlwaysLoveme/capacitor-plugin-filedownload

mustafa0x avatar Jun 21 '24 06:06 mustafa0x

I'd need to have this too

MattiaGeccheleAxa avatar Oct 10 '24 15:10 MattiaGeccheleAxa

Hey everyone, downloadFile has since deprecated in the filesystem plugin, there is now a @capacior/file-transfer, unfortunately it does not provide a way to abort downloads either.

I shall close this issue, please refer to https://github.com/ionic-team/capacitor-file-transfer/issues/7 for updates / tracking.

Thank you!

OS-pedrogustavobilro avatar Jul 11 '25 15:07 OS-pedrogustavobilro

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Jul 26 '25 16:07 ionitron-bot[bot]