An error has occurred. The file '' couldnt be saved
This is a sample documentPath string
/Users/Muhammad/Library/Developer/CoreSimulator/Devices/7088E29A-FA37-4945-9B81-C66C6FCC248A/data/Containers/Data/Application/9F75B2D2-6FBC-40D8-A658-AD7B16063720/Library/Caches/APP_NAME/aqeela abbas - Curriculum vitae 25-Nov-2013.pdf
I am using following code to download a file.
-(void) downloadFileWithPath:(NSString )link name:(NSString )name { NSArray paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString documentsDirectory = [paths objectAtIndex:0]; // Fetch path for document directory NSString documentsPath = (NSMutableString )[documentsDirectory stringByAppendingPathComponent:APP_NAME]; documentsPath = [documentsPath stringByAppendingString:[NSString stringWithFormat:@"/%@", name]];
}
But i keep on getting
An error has occurred. The file '' couldnt be saved
This is a sample documentPath string /Users/Muhammad/Library/Developer/CoreSimulator/Devices/7088E29A-FA37-4945-9B81-C66C6FCC248A/data/Containers/Data/Application/9F75B2D2-6FBC-40D8-A658-AD7B16063720/Library/Caches/APP_NAME/aqeela abbas - Curriculum vitae 25-Nov-2013.pdf