0

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

1

1 Answer 1

6

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.