• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

162
Vistas
How to pass a stream responseType to my client?

I am trying to download a file from my express js app :

const response = await Axios({
    method: 'GET',
    url: url,
    responseType: 'stream'
  })

However rather than doing this right after :

response.data.pipe(Fs.createWriteStream(path))

I want to send the response to my js client that requested my express js app with ajax, so that the file will directly be downloaded from my browser (client side) instead of server-side.

Any solution ?

almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can pass the express response object to the pipe method

response.data.pipe(res);
almost 3 years ago · Juan Pablo Isaza Denunciar
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda