Reputation: 59
This is Json Data
$scope.imageFileDisplayContent=
{
"indexFileDisplayContent": "PCFET0NUWVBFIGh0bWw+CjxodG1sPjxoZWFkPjxtZXRhI"
}
This is code written to convert 64base htmlfile to iframe
<iframe class="url-preview" ng-src="{{trustSrc(item.indexFileDisplayUrl)}}"></iframe>
How can i display 64 bit html file data into iframe . Thanks in advance
Upvotes: 0
Views: 2876
Reputation: 2466
It looks like you need to tell the iframe src that the data you gave him is in a 64 bit encoded form or else he won't know what to do with it.
You should try adding "data:text/html;base64," before the base 64 data to let the browser know that's the data he has gotten.
Here is an example (with no ng but it should work the same with):
<iframe class="url-preview" src="data:text/html;base64,PCFET0NUWVBFIGh0bWw+PGh0bWw+PGJvZHk+PGgxPkhlbGxvIHdvcmxkIDY0Yml0PC9oMT48L2JvZHk+PC9odG1sPg=="></iframe>
Upvotes: 6