You need to sign in to do that
Don't have an account?
HI, I have Html content in a string, Html content contains images and text. Unable to see images of html content on vf page.
Hi,
1) I am saving incoming Email body content in html attachment.
with this code
Attachment attach = new Attachment(Name = newEmail.Name + '.html', Body = Blob.valueOf(email.htmlBody),
ContentType = '.html', ParentId = newEmail.id);
insert attach;
2) now I am using the body of attachment like this ..
string attachBody=attach.Body.toString();
3) I am using string 'attachBody' on vf page like this
<apex:outputText escape="false" value="{!attachBody}">
Now issue is that.. I am unable to see few images on vf page.
As I see in debug logs, I found
1. if string 'attachBody' contains this <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAacAAAD7CAIAAABBtsz ... that is visible to me on vf page.
2. if string 'attachbody' contains this <img src="cid:3442459202_25472939 ... I see broken image
Your help would be appricaited.
Sameer Tyagi
<pre>
<apex:outputField value="{!attach.Body}" />
</pre>
<pre>
<apex:image value="{!attach.Body}" />
</pre>
<pre>
{!attachBody}
</pre>
1 . outputfield does not support blob
2. Content cannot be displayed: core.filemanager.ByteBlobValue cannot be cast to java.lang.String
getting this error If I use <apex:image value="{!attach.Body}" />
I am able to see image . if string 'attachBody' contains this <img src="data:image/pngbase64,iVBORw0KGgoAAAANSUhEUgAAAacAAAD7CAIAAABBtsz ...
and NOT able to see image on vf page if string 'attachbody' contains this <img src="cid:3442459202_25472939
string Attachbody contains HTML body(string and Images with HTML tags)
I am using outputtext with escape = "false" which hides HTML tags