I wrote some code to download a URL to my disk, using an NSURLRequest and an NSURLDownload. The download starts fine (at least, it sends downloadDidBegin
NSURLDownload *)download), but then it sends
My implementation of the function is as follows:
The logged error is
2011-07-17 01:48:43.194 URLDownloader[28031:903] Download failed! Error - The operation couldnt be completed. (NSURLErrorDomain error -3001.) [the URL in the NSURLRequest]
From what I can tell, this is the NSURLErrorCannotOpenFile error. I cannot find any explanation of why this error occurs, other then "Returned when NSURLDownload was unable to open the downloaded file on disk." from the documentation. So, why is this happening?
Fact that might be helpful(?): NSURLErrorCannotOpenFile is enumerated as kCFURLErrorCannotOpenFile. I have no idea what this means either....
Code:
-(void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
Code:
{
[download release];
NSLog(@"Download failed! Error - %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
}
2011-07-17 01:48:43.194 URLDownloader[28031:903] Download failed! Error - The operation couldnt be completed. (NSURLErrorDomain error -3001.) [the URL in the NSURLRequest]
From what I can tell, this is the NSURLErrorCannotOpenFile error. I cannot find any explanation of why this error occurs, other then "Returned when NSURLDownload was unable to open the downloaded file on disk." from the documentation. So, why is this happening?
Fact that might be helpful(?): NSURLErrorCannotOpenFile is enumerated as kCFURLErrorCannotOpenFile. I have no idea what this means either....
Last edited: