Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
How to download file from URL in React without opening preview

So far I have already seen a lot of questions where this type of question were asked but none of works in my case.

I would like to tell you in the first place is The Server Side is Not Mine! means the URL were from another source!

What I've tried is -


I have tried to add download attr in the anchor tag or <a href="urlhere" download></a> It will just open a new page with preview also tried with react Link none of them worked!


And tried with these libraries file-saver, js-file-downloader, same issues!


when trying one of those things I got an error saying -

Access to XMLHttpRequest at 'urlOfDownloadingfile' from origin 'http://localhost:3000'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
header is present on the requested resource. 

I think because the server-side is not controlled by me so that's why it is happening!

Is there any way I can solve this issue!

Any help will be always appreciated!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda