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

438
Vistas
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 Respuestas
Responde la pregunta

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 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda