Before Alamofire5 we could user encodingReesult of uploadRequest to get uploadProgress.
But now after uploading Alamofire to version 5, based on Alamofire Documentation, we can use .uploadProgress in order to get upload progress handler.
Here's my code:
AF.upload(multipartFormData: { multipartFormData in
multipartFormData.append(fileContent, withName: "file", fileName: filePath.lastPathComponent)
multipartFormData.append(token.data(using: .utf8)!, withName: "token")
}, to: uploadURL)
.uploadProgress { progress in
print(progress)
}
.responseJSON { [weak self] response in
print(response)
}
But uploadProgress closure never called during upload progress.
I've checked many stackoverflow questions but no one worked.
If u happen to have installed a library for network traffic debugging like Wormholy, then, checkout this issue thread. In short note, it's the issue with the library & uninstalling it, solves the problem. Not sure with other network debuggers though. To make things clear, try to playaround in a new, clean project and see if alamofire works in such environment.