Do NSURLDownload resume automatically handle modified data?

133 Views Asked by At

I know if I save resume data when my download failed, i can resume downloading later.

I wonder if the original file from server is modified before I try to resume downloading, 'initWithResumeData:delegate:path' will handle to decide to download from beginging of new file?

or should I request file information first and compare modification date myself?

(assuming a new file has same name but different attribute.)

I use bottom code.

NSData * rData = [NSData dataWithContentsOfFile:@"MY_RESUME_DATA_PATH"];
NSURLDownload * urlDownload = [[NSURLDownload alloc] initWithResumeData:rData delegate:self path:destFilePath]];
1

There are 1 best solutions below

0
Mike97 On

Sorry if is late, but resumeData simply compare the data stored in your plist with the new request. If nothing is changed you can resume your data...