Open lakshmisanthi opened 5 years ago
+1
+1
I am having the same CORS issue. Can somebody please provide an update or a workaround for this issue please?
Issue is only with jpg files the viewer will render a pdf document from the same location
+1
+1
Otherwise, the server hosted image file loads in a simple <img src={}/>
but not <FileViewer/>
I am having same issue now. What does mean of "+1"? Is this a solution? Please help me.
Thanks, @yangchih But in my thought, it is not a good solution to change the file in node_modules folder. Do you have any other ideas?
Thanks, @yangchih But in my thought, it is not a good solution to change the file in node_modules folder. Do you have any other ideas?
Although I add new line to code, it doesn't work :(
Any updates on this issue? Or any other package you guys could recommend?
I also have the same problem when I try to load a file from an external server.
Is this problem resolved? It doesn't still work for me. Or should I don't use this library?
Is this problem resolved? It doesn't still work for me. Or should I don't use this library?
finally i switched to something else since its not working.
Is this problem resolved? It doesn't still work for me. Or should I don't use this library?
finally i switched to something else since its not working.
what did you use now ?
@geekl1 @AlwaniAnis have you found an alternative or solution? Regards!
If you are using gcloud storage then try to setup cors there
[
{
"origin": ["*"],
"method": ["GET"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 3600
}
]
gsutil cors set cors.json gs://BUCKET_NAME
check official docs
still struggling by this
If you are using gcloud storage then try to setup cors there
- install gcloud SDK
- Create json file (cors.json)
[ { "origin": ["*"], "method": ["GET"], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ]
- Now config
gsutil cors set cors.json gs://BUCKET_NAME
check official docs
https://stackoverflow.com/questions/37760695/firebase-storage-and-access-control-allow-origin
Hi, I am new to react-file-viewer. I want to show view some images and documents in my application. so I have installed the react-file-viewer package. here is my sample code
import React, { Component } from 'react'; import {Container, Modal,Button} from 'semantic-ui-react'; import FileViewer from 'react-file-viewer';
const file = 'https://storage.googleapis.com/dwellingg-dev-site-image/default_images/home.jpg' const type = 'jpg'
export default class Hello extends Component {
} onError(e) { console.log(e, 'error in file-viewer'); } render() { return (
} };
I getting below error.
Access to Image at 'https://storage.googleapis.com/dwellingg-dev-site-image/default_images/home.jpg' from origin 'http://192.168.1.4:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.4:3000' is therefore not allowed access.
Thanks in advance