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

170
Views
How to download a file from the API in REACT?

I would like to download a file that comes from the api in React.js Thank you very much in advance...

This is my code

-- Consult the api --

const[data, setData]= useState(null);
const downloadRelase = async (id) => {
  try {
    const result = await clientAxios.get(`/api/comunicados/download/${id}/0`);
    setData(result.data)
  } catch (error) {
    console.log(error);
  }
};

-- Response "data" --

image the data

-- JSX --

<div className="p-0 col-12 col-md-6 text-primary">
  <a className="w-auto p-0 btn" href={} onClick={()=> downloadRelase(relase.id)}>
    Descargar firmado 
  </a>
  <span> | </span>
  <a className="w-auto p-0 btn" href="#!">
    Verificar firma
  </a>
</div>
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!