I want to open an email attachments(say .ppt, .doc, .xls .. etc files) through my iOS(iPad)app.
I am able to achieve the “Open In” on the mail attachments, my app opens up after that.
The handleOpenURL function will be called along with the url of the opened attachment.
Now in this function when i try to check for the file existence, it is not present.
NSFileManager *defaultManager = [NSFileManager defaultManager];
NSString *filePath = [NSString stringWithFormat:@"%@",url];
if ([defaultManager fileExistsAtPath:filePath]) {
NSLog(@"fileExists");
}else{
NSLog(@"file does not Exists");
}
What i want to achieve here is I want to copy the file through this url and paste it in some other folder.
But here the file itself doesn’t exists.
Any help is highly appreciated.
That’s not the proper way to convert an NSURL to a path. You should do: