Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda