ionic-team / ionic-team/ion-ios-filetransfer
Progress events not fired on PUT upload
- Dominant language
- Swift
- Stars
- 0
- Forks
- 7
- Avg merge
- 44m
- Merged PRs (30d)
- 1
Description
I'm working with capacitor/file-transfer and not getting progress events on large (PUT) uploads. I think the reason is the progress event not emitting until the status code is 200+ in this code , perhaps this is a guard for downloads?
```
func urlSession(_ session: URLSession, task: URLSessionTask,
didSendBodyData bytesSent: Int64, totalBytesSent: Int64,
totalBytesExpectedToSend: Int64) {
self.totalBytesSent = Int(totalBytesSent)
let response = task.response as? HTTPURLResponse
let statusCode = response?.statusCode ?? 0
if (200...299).contains(statusCode) { // <-- THIS IS THE PROBLEM
publisher.sendProgress(...)
}
}
Let me know if you'd like more info or a PR for this?
Thanks
Marcus
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.