📜  从 url typescript 代码示例创建文件对象

📅  最后修改于: 2022-03-11 14:48:31.509000             🧑  作者: Mango

代码示例1
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)