Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
How to create a downloadable file in nodejs and js?

I created a downloadable file in my web page using Javascript and nodejs. The problem is that when the user tries to download it, it takes forever to start the download and when it does it instantly downloads the file. What I want to do, is to show to the user the progress of the download, like in the image below enter image description here

in the server side I just serve the static file using express

const express = require('express')
const app = express()
app.use(express.static('app'));

app.listen(port, () => {
    console.log(`Example app listening at http://${serverIp}:${port}`)
});

in the client side I GET request the file

export const getAppFile = () => {
    return fetch("build/localServer.exe", {
        method: 'GET',
        'content-disposition': 'attachment',
        'content-type': 'application/octet-stream',
      })
      .then((response) => response.blob());
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The download progress is handled by the clients computer. I don't think the computer talks to the browser on the progress. You may want to try something like this: https://stackoverflow.com/a/4168965/15263184

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda