tus_background_upload 0.1.1
tus_background_upload: ^0.1.1 copied to clipboard
TUS resumable uploads that keep running while the app is backgrounded or the device is locked, over native transports (iOS background URLSession, Android WorkManager via background_downloader).
Changelog #
0.1.1 #
- Fix: the TUS PATCH was sent with the file's own mime type (e.g.
video/mp4) instead ofapplication/offset+octet-stream, so spec-compliant servers (Bunny among them) rejected it.background_downloader's native binary-upload code overwrites theContent-Typeheader with the task'smimeTypeon both platforms; the transport now setsmimeTypeto the TUS content type explicitly. - A failed PATCH now folds the HTTP response code, exception description, and response body into the thrown
HttpExceptionmessage instead of only the finalTaskStatus.
0.1.0 #
- Initial release.
TusUploader: TUS protocol state machine with pause (server offset kept), resume (TUS HEAD + continue), cancel, and whole-file progress rescaling.BackgroundDownloaderTusTransport: the PATCH runs as a native background transfer (iOS backgroundURLSession, Android WorkManager), so uploads keep running while the app is backgrounded or the device is locked.configureBackgroundUploads: one-call setup for long-running transfers — AndroidrunInForeground(lifts the ~9-minute WorkManager cap) with the mandatory notification, and a configurable iOS resource timeout (default 8h).BackgroundMultipartUploader: multipart uploads for regular attachments over the same native transports.createTusUpload: TUS creation-extension helper (Upload-Length/Upload-Metadata→Location).- Optional
http.Clientinjection oncreateTusUploadandBackgroundDownloaderTusTransport(connection reuse, testability). requestBackgroundUploadNotificationPermission: runtime notification-permission request for the Android 13+ foreground-service promotion.