I am using react-doc-viewer to view different file types, all other file types works fine, but the issue occurs when trying with pdf files, the react-doc-viewer itself is hitting the uri provided by azure storage but it gives CORS error, and when i hit the same uri on other tab the files is getting downloaded, i am not understanding if the Cross-origin isn’t allowed then why is it letting me download the file from same url and not letting viewer work with it ?
I Simply provided uri and file type to the react-doc-viewer:
const docs = [
{
uri : {My URI From Storage},
fileType: 'pdf',
},]
<DocViewer
pluginRenderers={DocViewerRenderers}
documents={docs}
config={{
header: {
disableHeader: true,
},
}}
style={{ height: '85vh' }}
/>
Udit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.