-(void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
if([recievedData length]) [ recievedData setLength:0 ];
download_size =[response expectedContentLength];
}
I have this code. download_size is NSInteger. expectedContentLenght always return: -1. Maybe someone know why? I tried use long, but effect was the same.
Thanks for help.
NSMutableURLRequest
and say[req setValue:@"" forHTTPHeaderField:@"Accept-Encoding"]
. (I learned this from an answer on a duplicate question. ) – Jillion