Wanted to find size of a file on some server before downloading it in iOS 7... I have a method of NSURLConnectionDelegate but it is deprecated after iOS 4.3
Here was
try this will help . . . . .
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse
*)response
{
NSHTTPURLResponse * pHttpUrlResponse = (NSHTTPURLResponse *) response;
if ([response respondsToSelector:@selector(allHeaderFields)])
{
NSString * fileLength = [NSString stringWithFormat:@"%lld",[pHttpUrlResponse expectedContentLength]];
}
}
happy coding :)