226
Views
3
Comments
Solved
Opening a pdf embedded in iFrame with Content Security Policy

Hello,

I am trying to open a PDF embedded in an IFrame. But I am getting the following error on Console:



My environment is CSP enabled.

Source Code:

"<iframe src='data:application/pdf;base64, " +
File.Base64  + "' width='" + Width + "' height='" + Height + "'></iframe>"

Please help.



UserImage.jpg
Smita Salve
Solution

We need to add this:




2020-06-27 18-35-53
Rohan Hanumante

Hi Smita,

You need to enable Content security Policy in the LifeTime.

I hope that will resolved your issue...

Cheers....

UserImage.jpg
Smita Salve

Enabled the CSP. But still getting the issue. Need to understand what value to be put in.

UserImage.jpg
Smita Salve
Solution

We need to add this:




Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.