I have a simple command line application to test the presence of files. The files are very large, however, and I would like to check that they are there without downloading the whole file. This is what I have but it downloads each file:
NSURL *url = [NSURL URLWithString:downloadPath];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLResponse *response = nil;
NSError **error=nil;
NSData *data=[[NSData alloc] initWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:error]];
NSInteger httpStatus = [((NSHTTPURLResponse *)response) statusCode];
if(httpStatus == 404)
{
NSLog(@"%@ NOT FOUND!",[productDic objectForKey:@"fileName"]);
}
The files I am looking for are .zip and are not found locally.