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

175
Views
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
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!