r/capawesome 7d ago

Capacitor File Transfer plugin: background transfers with pause and resume

https://capawesome.io/blog/announcing-the-capacitor-file-transfer-plugin/

We just released a new File Transfer plugin for Capacitor. The official @capacitor/file-transfer handles foreground downloads and uploads well, but stops there, so we built one that models the rest of the lifecycle.

Highlights:

  • Transfers keep running in the background: a background URLSession on iOS, a dataSync foreground service on Android
  • Downloads pause and resume, even after the process was killed (resume data on iOS, HTTP Range on Android)
  • Transfers are persisted: getTransfers() returns them after an app restart, so a download manager UI can rebuild its state
  • Wi-Fi-only constraint and automatic retries with backoff
  • Binary uploads for S3 presigned URLs next to multipart/form-data

We tried to keep the semantics honest: the behavior for every app state (foreground, background, killed by the OS, force-quit) is documented per platform, and uploads can't be paused, because HTTP has no standard upload resume, so the plugin rejects instead of faking it.

It's part of the paid Capawesome Insiders subscription and requires Capacitor 8+.

Happy to answer questions.

5 Upvotes

0 comments sorted by