How to be able to convert image to base64 and avoid same-origin Policy

前端 未结 3 1678
悲&欢浪女
悲&欢浪女 2021-01-12 18:57

I\'m trying to convert an image (link) to base64 to be able to store in the Browser side (IndexedDB), but i\'m not able to do that, I have been looking for a solution for da

3条回答
  •  有刺的猬
    2021-01-12 19:31

    for same origin policy you must add headers for server side from where you want your images

    here is how to do this - http://enable-cors.org/server.html

    for development purpose you can install 'CORS' extension in CHROME browser to allow cross origin request

    hope this helps and solve your issue.

提交回复
热议问题