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

186
Views
JavaScript Blob not working on mobile browser

I have some problems with Blob. I have a website running on Vue 3, and there is one action that is downloading pdf from the backend, but it's not working from mobile browser. It's actually working from the mobile browser, but we have another browser that is opening (just like when you click on facebook url it's opening in their own browser). So every time when I try to download it from that browser it fails. What am I doing wrong?

async function downloadPdfLink(args: IPaymentDownloadPDFArguments): Promise<void> {
    isPDFLoading.value = true;

    return get('/users/' + args.userId + '/payments/' + args.paymentId + '/download-pdf', {
      responseType: 'arraybuffer'
    }).then((response) => {
      const blob = new Blob(
          [response.data],
          { type: 'application/pdf' }
        )
      const url = window.URL.createObjectURL(blob);
      const link = document.createElement('a');
      const name = convertToKebabCase(args.name) + moment(new Date()).format("_YYYY_DD_MM");
      link.href = url;
      link.setAttribute('download', name + '.pdf');
      document.body.appendChild(link);
      link.click();
    })
      .catch((reason) => {
        throw new Error(reason)
      })
      .finally(() => {
        isPDFLoading.value = false;
      })

  }

btw I'm not really able to debug it from that browser.

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!