You need to sign in to do that
Don't have an account?
Taps mak
how to save image in record
Hi,
I have one application and in that I have to capture the image through webcam and then have to save that image in he record.How can I do this?Please I need urgent help.
thx.
@Taps Mak,
You can have rich text field type and save image in that.
Hi Mak,
Iam here sending rough code to save image dynamically
<apex:inputFile value="{!file}" >
</apex:inputFile>
<apex:image url="/servlet/servlet.FileDownload?file={!FieldId}" height="100" width="200"/><br/>
<apex:commandButton Value="Upload" action="{!Upload}"/>
Controller
public PageReference Upload() {
document d=new document();
d.Name=Name;
d.body=file;
d.folderid='00l90000001SuJs'; //folderid where the document will be stored insert d;
insert d;
List<Document> attachedFiles = [select d.Id,d.body,d.Name from Document d order by Id Desc limit 1];// to display last saved image
if( attachedFiles != null && attachedFiles.size() > 0 ) {
con1=false;
FieldId = attachedFiles[0].Id;
}
return null;
}