0

I have some images in my react project's public folder. I can read them using fetch API, which gives me readablestream. I want to convert the output to type File. How can I do it? Example of the File type I'm looking for is given below.

const file = new File(['foo'], 'foo.jpg', {type: 'image/jpg'})

Purpose: An API I use only accept File type

Sachin Titus
  • 1,408
  • 1
  • 12
  • 29

0 Answers0