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,960
  • 3
  • 23
  • 41

0 Answers0