Is there anyway to check whether a particular image file exists in my iPhone. Lets say my image name is IMG_123.JPG. I want to search this image and if it exists I want to create a NSInputStream
object using that File. If the image is not in NSBundle
it can be saved in photo library or somewhere.
Please help me. Thanks
UPDATE
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [pathArray objectAtIndex:0];
NSString* dataPath = [documentsDirectory stringByAppendingPathComponent:@"IMG_2594.JPG"];
UPDATE 2
Getting the image when user click the picker image
copyOfOriginalImage = [UIImage imageWithCGImage:[[imageAsset defaultRepresentation] fullResolutionImage]];
Convert the image into NSData
imageData = UIImageJPEGRepresentation(copyOfOriginalImage, 1.0);
Then I convert it into base64
strEncoded=[imageData base64EncodedStringWithOptions:0];