I need to download an image from the iphone gallery, but I do not get the path of the selected image (using the image picker )
in the delegate method of the image picker i do the following
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSString *strImagePath = [info valueForKey:UIImagePickerControllerReferenceURL]; NSString *strImagePath1 = [info valueForKey:UIImagePickerControllerMediaURL]; NSLog(@"%@",strImagePath); NSLog(@"%@",strImagePath1); NSLog(@"%@",info); }
and the information dictionary contains the following key values
{ UIImagePickerControllerMediaType = "public.image"; UIImagePickerControllerOriginalImage = "<UIImage: 0x16adc0>"; UIImagePickerControllerReferenceURL = "assets-library://asset/asset.PNG?id=1000000153&ext=PNG"; }
I used the value for the UIImagePickerControllerReferenceURL key as the image path for uploading it to FTP, but I could not upload the file, maybe the path that I accept is incorrect.
can someone help me how can I take the actual path of the selected image using the image picker
source share