You need to sign in to do that
Don't have an account?
disturbed118
How to get image on visualforce page saved as an attachment
Hi i have a canvas area where users draw their signatures, but how can i capture this as an attachment when saving?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi i have a canvas area where users draw their signatures, but how can i capture this as an attachment when saving?
It seems that you are uploading an image on visual force page which is already saved in an attachment. You can use SOQL query in controller on attachement object.
Find below a sample code to fetch an image from document object and show on a Visual force page :
String strOrgId = UserInfo.getOrganizationId();
String strDocUrl = '/servlet/servlet.ImageServer?oid=' + strOrgId + '&id=';
String tempUsrPhoto ='';
String Profile_photo.png ;
List<Document> lstDoc = Database.query('SELECT d.Id, d.Name, d.Body, d.ContentType, d.IsPublic, d.FolderId FROM Document d WHERE d.Name = 'profile-photo');
if(lstDocs != null && lstDocs.size() > 0)
{
for(Document doc :lstDocs)
{
if(doc.name == 'profile-photo')
tempUsrPhoto = strDocUrl + doc.id;
}
}
Profile_photo.png = tempUsrPhoto;
Hope this helps.
Hi there,
Will you please send me the code for visualforce page.
Thanks in advance...
Regards
What are we returning from the method? VF code, please