When I'm trying to access a pdf file from the files tab, I'm running into the below issue.
Message: Cross-origin redirection to https://name-space--c.documentforce.com/sfc/servlet.shepherd/document/download/0692I000009ZWwuQAG denied by Cross-Origin Resource Sharing policy: Origin https://name-space.lightning.force.com is not allowed by Access-Control-Allow-Origin.
If I directly give this in the browser: https://name-space--c.documentforce.com/sfc/servlet.shepherd/document/download/0692I000009ZWwuQAG it is downloading the file.
I've added the below two to the CORS (in setup):
https://name-space--c.documentforce.com
https://name-space.lightning.force.com
anything else I'm missing, please suggest.
Thanks
Update
I'm trying to load a PDF in a container .. so that user can view/read on the page itself ... something like PDF file download in Lightning (using mozilla pdf library)
my code
<iframe src="{!$Resource.PDFViewer + '/web/viewer.html?file=/sfc/servlet.shepherd/document/download/0692I000009ZWwuQAG' }">PDF Loading...</iframe>