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

437
Visualizações
converting blob to File object in nodejs

I am trying to convert Blob to a File object in nodejs. The Blob is passed from my frontend to my backend. I then want to convert it in my backend.

Here is my current code:

frontend

var data = {
  "file": file, //this is blob
  "file_name": bucket_string
};

return await axios.post(`/files/upload-file`, data);

backend

const file = new File(data['file'], "tests/" + customer + "/" + sound + ".wav");

Currently this throws an error:

ReferenceError: File is not defined

How can I properly convert the data in nodejs?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I don't have enough reputation to comment so sorry that this is a full post. File is an interface in TypeScript but does not specifically exist with node.js (sans TypeScript). I don't see anything referencing TypeScript in your code so maybe it's because you're not using typescript. For information on the File interface reference the docs here. Without knowing if you're using typescript I'm not sure what more to say about the File interface.

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