Answer the question
In order to leave comments, you need to log in
Is there an equivalent to new File() in nodejs?
I need to send a link to the image to my backend, get this image, convert it to File (as in js in the browser) and then send it to s3. This is how I get a picture as a blob in nodejs:
const url = 'https://someurl.com/images/5745rt.png';
const blob = await fetch(url)
.then(response => response.blob())
.then(response => response);
const file = new File([blob], fileName); // error
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question