Can't list images/video [ReactJs]
Hello
I come here because I have a problem with Cloudniary. I use ReactJS and when I upload an image / video everything goes well but when I want to list my uploads via resources / or list / I have the following error: 'No' Access-Control-Allow-Origin 'header is present on the requested resource. Origin 'http: // localhost: 3000' is therefore not allowed access. The response had HTTP status code 401. '
When I type search my data directly via the URL I have the JSON that appears.
I also install the REACT SDK but still nothing.
Thanks
-
Hi Raya,
That's the code I use to get my list :
axios.get('https://api.cloudinary.com/v1_1/sooonr/resources/image/upload?max_results=500&prefix=test/user').then(res => {
console.log(res.data.ressources);this.setState({gallery:res.data.resources});});Thanks -
Hi Sooonr,
Using resources is not available client side since it means exposing your API secret. That being said, you can use list to list all videos with a specific tag.
For example,
http://res.cloudinary.com/<cloud_name>/video/list/<tag_name>.json
You could take a look at this tutorial for more information and pointers- https://github.com/cloudinary-developers/build-a-mini-netflix/blob/master/React/display-videos.md
-
Hi Sooonr,
Please open a ticket at support@cloudinary.com with more details on your implementation.
Post is closed for comments.
Comments
5 comments