Alcumus/react-doc-viewer

No Renderer for file type application/octet-stream

masudhossain opened this issue · 7 comments

Getting this error when i try to view pptx or docx files.

import React from 'react'
import { useRouteMatch } from "react-router-dom";
import DocViewer, { MSDocRenderer } from "react-doc-viewer";

const Document = (props) => {
  const match = useRouteMatch();

  const docs = [
    { uri: "https://queue.nyc3.cdn.digitaloceanspaces.com/lkfjslkdfj.pptx" }
  ];

  return(
    <React.Fragment>
      Document.js
      <DocViewer documents={docs} pluginRenderers={[MSDocRenderer]} />
    </React.Fragment>
  )
}

export default Document; 
// https://queue.nyc3.cdn.digitaloceanspaces.com/agency%20reachout%20.docx
// https://queue.nyc3.cdn.digitaloceanspaces.com/lkfjslkdfj.pptx

I am getting same issue when try to render a pdf file.

I am getting the same issue for docx file type. Any update on this issue?

@masudhossain @amansani This type of issue is server related. The server that returns the documents should specify in the header the type of document. The solution will depend on your current architecture.
I hope this helps to resolve your issue.

@lruizcr yes, this helped

@lruizcr can help with an example please

can someone elaborate the solution. we are facing the similar issue while we reading from aws s3 bucket

can someone elaborate the solution. we are facing the similar issue while we reading from aws s3 bucket

I am getting the same issue for reading file from s3. Any update on this issue?