+ Start a Discussion

Download and store an image in Salesforce org



At present I am able to download an image to the local disk. But I need to download an image and store it  as a document in Salesforce Org so that it can be attached to the email.


Could anyone please help me on how to download and store an image as a document in Salesforce Org.


Thanks in advance.





You can store images and other static files as Static Resources.  This document explains how to upload the files and reference them from Visualforce:




Alex AppaduraiAlex Appadurai
UIImage* img =[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[(ZKSObject*)[records objectAtIndex:indexPath.row]        fieldValue:@"FullPhotoUrl"]]]];