I faced with a strange problem. I load file from the Internet using NSURLSession and NSURLSessionDownloadTask. Here is the code
NSU
-1 is NSURLSessionTransferSizeUnknown, which means that the http server did not provide
a "Content-Length" header (and the data is sent using "Transfer-Encoding: chunked").
There is probably not much that you can do. You could try if the workaround from https://stackoverflow.com/a/12599242/1187415 works in your case as well:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:anURL];
[request addValue:@"" forHTTPHeaderField:@"Accept-Encoding"];