Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

203
Vistas
Is it possible to download a BLOB after the preview has been opened in a new tab?

I use the below code to download some binary data (a PDF document) and open result in a new tab:

$.ajax({
    url: this.downloadurl,
    xhrFields: {
        responseType: "blob"
    }
})
.done(blob => {
    var url = URL.createObjectURL(blob);

    //open blob in new tab
    window.open(url);
    
    //additionally, download the document
    var a = $("<a>", {
        href: url,
        download: this.filename,
    }).appendTo(document.body);
    a[0].click();
});

It also downloads the document automatically because I found out that it's not possible to download it using the download icon in the preview. Below is the PDF document preview in Chrome. If I click on the download icon:

enter image description here

It will show this :

enter image description here

Is there a way to prevent this? It looks like the URL can only be used once.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda