@david001 you have to configure your S3 for this, check this out: https://stackoverflow.com/a/50056944
Aug 22, 2021
6
Level 5
CORS problem
Hi, my images are uploaded to s3, once it uploaded it get the image url. If I copy that url and paste in web browser I can see the image but on js I get error message
Access to image at 'https://snapsstaging.s3.ap-southeast-2.amazonaws.com/004d982a6f6b7028df4fbf2036c70e76badc8789.png' from origin 'https://org.snap.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
. I am accessing file from localhost. I am loading an image in canvas
let imageURL = "https://snapstaging.s3.ap-southeast-2.amazonaws.com/004d982a6f6b7028df4fbf2036c70e76badc8789.png";
alert(imageURL)
base_image = new Image();
base_image.crossOrigin = "Anonymous"
base_image.src = imageURL
base_image.onload = function(){
ctx.drawImage(base_image, 0, 0,800,400);
};
Please or to participate in this conversation.