react-file-viewer icon indicating copy to clipboard operation
react-file-viewer copied to clipboard

Opening documents from an HTTP url results to error (screenshot attached)

Open ace-rivera opened this issue 6 years ago • 2 comments

I am having problems when loading files from our server. The files are getting downloaded without problem in my machine, it only has problems when I'm using the link in the filePath.

Error1

ace-rivera avatar Dec 02 '19 06:12 ace-rivera

Same here

paschaldev avatar Sep 15 '20 15:09 paschaldev

Try adding:

{'Access-Control-Allow-Origin': 'localhost:3000','Access-Control-Allow-Credentials': True}
                               //your react development server

to response. I don't know what backend you're using, but in django you also need to add : CORS_ORIGIN_ALLOW_ALL = True in settings.py. Actually i don't know if it will work in rest framework or something other.

mka142 avatar Mar 22 '21 19:03 mka142