I'm trying to download content with an URL to a local file system in my iPad (cachedDir ? ) with this function:
- (IBAction)download:(id)sender {
NSURL *url = [NSURL URLWithString:@"http:www.google.de"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
[request setDownloadDestinationPath:@"/Users/ben/Desktop/my_file.pdf"]; // Which //directory??
}
Which directory do I have to choose for my path if I want to store the data as long as possible without getting rejected by Apple, and how do I retrieve the data I've saved?
Can somebody help?
Try out this my code for save pdf in document using below code
and retrive your file using
The best place to store documents that you want to keep around is your application's Documents directly. You can find the path to it like so:
Apple have a useful piece of documentation about the iOS file system and where to store particular types of files: http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html