I am trying to implement downloading a large file and show the current move of the user, but block it:
-[AFURLConnectionOperation setDownloadProgressBlock:]
returns invalid bytesRead and totalBytesRead (they are less than they should be).
For example: if I have a file of 90 MB, and when it is fully loaded, the last call to the block in setDownloadProgressBlock: gives me a totalBytesRead value of about 30 MB. On the other hand, if the file is 2 MB in size, the last call to the block gives the correct 2 MB totalBytesRead .
AFNetworking is updated to the latest version from github.
If AFNetworking cannot do it right, what solution can I use?
Edit: I determined that even if the file is not downloaded completely (and this happens each time with a relatively large file) AFNetworking causes a success block in:
-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]
I asked a similar question here about this situation, but received no answers.
I can check the downloaded code and the actual file sizes, but AFNetworking does not have an API to continue partial downloads.
source share