我有一个简单的指挥线应用程序,测试档案的存在。 然而,这些档案非常庞大,我要核实,它们没有下载整个档案。 这是我掌握的,但下载了每个档案:
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.