I am downloading image from UIWebView with this method
NSURL *imgUrl=[[NSURL alloc] initWithString:[[DataPassing sharedManager] pageIMGurl]];
NSData *imgData = [NSData dataWithContentsOfURL:imgUrl];
UIImage *img = [UIImage imageWithData:imgData];
now I want to send this downloaded or saved or data Image with email using MFMailComposeViewController
NSData *imageData = UIImagePNGRepresentation(image);
[mailer addAttachmentData:img mimeType:@"image/png" fileName:@"mobiletutsImage"];
Now issue comes that I don't know the type of downloaded image in 'img', so i can put rite mimeType:@"image/png". What if the downloaded image is jpeg?
how to store multiple mimetypes and check with "img" and then send.