Answers for "create file object from url typescript"

0

create file object from url typescript

fetch('//my-image-url')
      .then((e) => {
        return e.blob()
      })
      .then((blob) => {
        let b: any = blob
        b.lastModifiedDate = new Date()
        b.name = ''
        return b as File
      })
// Promise returning a File Object
// (usefull for previewing image in updating forms)
Posted by: Guest on June-11-2020

Code answers related to "create file object from url typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language