I was wondering how to check and update the file for my iPhone using ASIHTTP
so far I:
__block BOOL complete = NO; __block BOOL failed = NO; NSURL *url = [NSURL URLWithString:@"http://notasdasd.com/file.txt"]; ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:url]; [request setDownloadCache:[ASIDownloadCache sharedCache]]; [request setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy]; [request setCompletionBlock:^{complete = YES;}]; [request setFailedBlock:^{failed = YES;}]; [request startSynchronous]; NSString *latestText = [request responseString];
And I want to check the old version in the cache directory and compare the latest header change with the changed file date in the cache directory and then replace.
source share