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

193
Visualizações
Express CSV download link in email triggers download on mac but not windows

I'm using Express and ExcelJs to create a CSV that users can download. I'm sending the users an email using Sendgrid and putting the params in a link in the email that dynamically generates the CSV. Everything works locally, and on macs. But on my windows computer, what happens is when I click the link, a new tab temporarily opens, then closes. Here is the ExcelJs code that being returned from the script that actually creates the CSV (with all the CSV logic excluded):

return await workbook.xlsx.writeBuffer()

then this is the Express code that sends the CSV to the user in the response:

const buffer = await generateWorkbook(csvData, styleInfo)

res.status(200)
  .set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
  .attachment("csv.xlsx")
  .send(buffer)

Any thoughts why this doesn't work across all platforms? Follow up question, if it isn't possible for this approach to work across all platforms, would a more consistent approach be to create a new tab, send the user to a page in our domain, then initiate the download from there and close the new tab?

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