zhanziyang / vue-croppa

A simple straightforward customizable mobile-friendly image cropper for Vue 2.0.
https://zhanziyang.github.io/vue-croppa/
ISC License
967 stars 128 forks source link

CORS Problem issue. #126

Open rubencool opened 6 years ago

rubencool commented 6 years ago

I found CORS Problem in your library. While uploading Avtar image there wasn`t problem. so when i was uploading photo from list of photo i had saved from gallary then CORS problem aries.. i had shown error message below what i got..

Access to Image at 'http://xx.xxx.xxx.xxx:8000/media/gallery/travelBus_F0ck4Gd.png' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

Sorry that i cannot show my real server ip for security reason. so x denote server ip. so how can i solve these issue ?

zhanziyang commented 6 years ago

Make sure the server response of the image has the header Access-Control-Allow-Originset to *, otherwise it means the resource can not be accessed from other origins.