Alcumus / react-doc-viewer

Apache License 2.0
208 stars 101 forks source link

No Renderer for file type application/octet-stream #84

Open masudhossain opened 3 years ago

masudhossain commented 3 years ago

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
lruizcr commented 2 years ago

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

amansani commented 2 years ago

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

lruizcr commented 2 years ago

@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.

arpitprod commented 2 years ago

@lruizcr yes, this helped

divanshu222 commented 2 years ago

@lruizcr can help with an example please

lakshmi-intechcode commented 2 years ago

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

sanjay-techuz commented 1 year ago

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?