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

367
Vistas
How do I extract the Blob and the ArrayBuffer / TypedArray from the Formidable parsed object? In Node.js

Long story short, I used a DataForm object that contains a blob of an image as one of the parts and sent it to my node.js server into the formidable parser:

    //blob enters the files variable
    formParser.parse(req, (err, fields, files)=>{
        if(err)throw err; 


        const fileInfo = JSON.parse(fields.JSON);

        //figure out how to read the blob, how to get it's array buffer, then write to C disk
        console.log(files);

        //fs.writeFile() here




    })

How do I extract the Blobs ArrayBuffer from this persistent file in formidable that looks like this:

{
  Binary: PersistentFile {
    _events: [Object: null prototype] { error: [Function (anonymous)] },
    _eventsCount: 1,
    _maxListeners: undefined,
    lastModifiedDate: 2022-06-15T17:44:50.214Z,
    filepath: 'C:\\Users\\rnata\\AppData\\Local\\Temp\\f962bfe8ab505addfba1e4600',
    newFilename: 'f962bfe8ab505addfba1e4600',
    originalFilename: 'blob',
    mimetype: 'image/png, image/jpg, image/jpeg',
    hashAlgorithm: false,
    size: 373021,
    _writeStream: WriteStream {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      path: 'C:\\Users\\rnata\\AppData\\Local\\Temp\\f962bfe8ab505addfba1e4600',
      fd: 4,
      flags: 'w',
      mode: 438,
      start: undefined,
      autoClose: true,
      pos: undefined,
      bytesWritten: 373021,
      closed: false,
      [Symbol(kFs)]: [Object],
      [Symbol(kCapture)]: false,
      [Symbol(kIsPerformingIO)]: false
    },
    hash: null,
    [Symbol(kCapture)]: false
  }
}

What classes do I need, or what methods do I have to use, so that I can extract an arraybuffer and use it in fs.writeFile().

Thank you!

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