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

296
Views
React cannot download blob data through anchor tag on Chrome
const response = await axios({
  ...
})

if (response && response.status == 200) {
   const url = window.URL.createObjectURL(
      new Blob([response.data], { type: 'text/plain' }),
   )
}
setState({
  ...state,
  fileLink: url,
})

JSX

{state.fileLink && (
  <p>
    Click{' '}
    <a
      href={`${state.fileLink}`}
      target="_blank"
      download="file.txt"
      rel="noreferrer"
    >
      here
    </a>{' '}
    to download your file
  </p>
)}

The flow is: The user clicks on a button which sends request to server. The server sends back txt data to the browser. The js then creates a blob from the response data and points the a href to the blob url.

I can see the response data as well as the blob url.

However, when the a tag is clicked, I get ERR_FILE_NOT_FOUND. (I have disabled Ad blocker as was suggested in another thread)

The full error in Chrome is:

Your file couldn’t be accessedIt may have been moved, edited, or deleted. ERR_FILE_NOT_FOUND

The error in Firefox is:

Uncaught Error: Access to 'blob:https:..' from script denied

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!