I'm trying to load pdf file inside of iFrame in REACT, the code looks like this:
render(){
return(
<iframe
sandbox="allow-same-origin allow-scripts allow-forms"
title="PortletIFrameWidget"
src={'.resources/crayola.pdf'}
ref={(f) => { this.ifr = f }}
/>
)
}
and I'm getting a warning:
Resource interpreted as Document but transferred with MIME type application/pdf: "http://localhost:8080/resources/crayola.pdf"
but when I go to the link: "http://localhost:8080/resources/crayola.pdf" I can easily see the content of PDF, so there is the pdf file, the problem is: it's not being uploaded/rendered in iFrame. Why?
THIS WORKS IN MOZILLA FIREFOX, AND IN EDGE, but not in CHROME.
any idea why is this happening? And how to load PDF file in iFrame in REACT