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

436
Views
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 answers
Answer question

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 Report
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!