Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Error de depósito de Amazon s3: no hay ningún encabezado 'Access-Control-Allow-Origin' en el recurso solicitado

Estoy tratando de obtener una imagen del cubo de Amazon s3 usando el siguiente código:

 const downloadImg = (imgurl, name) => { console.log(imgurl); fetch(imgurl, { method: 'GET', headers: {} }) .then(response => { response.arrayBuffer().then(function(buffer) { const url = window.URL.createObjectURL(new Blob([buffer])); const link = document.createElement('a'); link.href = url; link.setAttribute('download', `${name}.svg`); document.body.appendChild(link); link.click(); }); }) .catch(err => { console.log(err); }); };

Este es el error que recibo: Access to fetch at 'https://***.amazonaws.com/withText/2022/punkhealth.svg' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Tengo la siguiente configuración de CORS en el depósito s3:

 [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "HEAD" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [ "Access-Control-Allow-Origin" ] } ]

¿Cómo se puede solucionar este error? Además, se puede acceder a la URL a través del cartero.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!