Is it possible to convert an image from an external source to the base64 database side?

I tried converting the image from an external source to a base64 string using html and the toDataUrl() tag and canvas , and it does not work. It throws a Dom Exception 8 security exception, which I later discovered that it does not allow you to convert these images from an external source.

I have a way to do this on the server side, but I want to reduce the load on my server by uploading images. Is there any way around this?

+4
source share
1 answer

You can get the image on the server side, and then pass it to the client as a proxy. It will look as if it were selected on your server, and then on the JS client side do the conversion. Your server will not perform the conversion, but will only act as a bridge to solve the security problem.

+3
source

Source: https://habr.com/ru/post/1479986/


All Articles