I want to download some files and show the downloading progress with progressview. The format is currentSize/totalSize. As you know, I can get the total size using content-length of http response. However, sometimes you cannot find the attribute in headers. So, my question is how can I get the total size of file to be download? Or is there any way to make content-length reappear in headers.
1
votes
1 Answers
0
votes
NSURLResponse
has a method called -(long long)expectedContentLength
It returns the expected content length or NSURLResponseUnknownLength
if the length can't be determined.
Source: Apple documentation