Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!