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

242
Views
How to replace URL.createObjectURL() for blob cases

I have the function below and using the deprecated URL.createObjectURL() method:

const downloadExceptionFile = async () => {
    const resp = await getExceptionFile();

    const link = document.createElement('a');
    link.setAttribute('download', 'excecoes.xlsx');
    link.href = URL.createObjectURL(new Blob([resp.data]));
    document.body.appendChild(link);
    link.click();
    link.remove();
  };

I`m using react, i try use this.srcObject and this.src as recomended in HTMLMediaElement.srcObject documentation, but, i just got an undefined error in my face.

How can i replace URL.createObjectURL() since this method its deprecated?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Long story short:

You don't need to change that code since URL.createObjectURL() is not deprecated.

The specific use case of creating an object URL to attach to a media element (e.g. <video>) is, and for that you should use .srcObject instead.

about 4 years ago · Juan Pablo Isaza Report
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!