When downloading a file, I want to resume downloading. For instance:
NSFileManager *fm = [NSFileManager defaultManager]; NSString *downloadTempPath = [_tempPath path]; if ([fm fileExistsAtPath:downloadTempPath]) {
This will create a receive request with a header like this:
Range: bytes = 1000-
I would expect the first answer to 206 to give me a piece where I asked him to start, having a header and a value similar to this (unloaded from allHeaderFields ):
"Content-Range" = "bytes 1000-340197 / 340198";
But sometimes it jumps ahead and returns something like this:
"Content-Range" = "byte 32000-340197 / 340198";
This is really bad, because I need these bytes from 1000-32000, and this did not give me.
I know that there is no server error, because when I hang on the server, it returns the section that I requested. Also, when I use wirehark, I do not see any packet going to the server. So this is a problem from iOS, possibly with NSURLCache
source share