0

I'm working on a reactjs project which has some files stored in the AWS s3 bucket. So when I try to view those files via iframe it doesn't get loaded & also I tried react-file-viewer package then it will give me errors of memory overflow and app crash.

Below is the file which I'm trying to download as a sample : https://ciao-live.s3.ap-south-1.amazonaws.com/CIAO_ERP/Documents/CustomerDocuments/1581489168529-pdf-sample.pdf

How can I solve this?

Update

I have got a solution unfortunately, this won't work for my AWS files, it will only download the files when it's in AWS S3 bucket:

 <object            width="100%"
                    height="100%"
                    data="https://ciao-live.s3.ap-south-1.amazonaws.com/CIAO_ERP/Documents/CustomerDocuments/1581489168529-pdf-sample.pdf"
                    type="application/pdf"
                  >
                    File Load Fails!
                  </object>  
4

1 Answer 1

-1

Try with below code. only this help for image

import img from "../../assets/img/logo(name).svg"; //Try to import your image using AWS s3 bucket

   render() {
        return (
            <div className="content" style={{ overflow: "auto"}}>
                 <img id="logo-img" src={img} alt="logo" /> 
            </div>
       )
    }

Sign up to request clarification or add additional context in comments.

1 Comment

thank you! I have fixed with the image but still struggling on pdf & docs. I have tried iframe but it will automatically download the pdf file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.