Convert blob to file

后端 未结 4 1131
半阙折子戏
半阙折子戏 2020-12-24 03:10

I need to convert a blob to file i javascript.

Im using File API

var blob = new Blob(byteArrays, { type: contentType });

This is r

4条回答
  •  孤独总比滥情好
    2020-12-24 03:30

    In IE10 there is no File constructor, but you can use the following in typescript:

    private createFile(bytes: string, name: string): File {
        const file: File = Object.assign(new Blob([bytes]), { lastModifiedDate: new Date(), name: name });
        return file;
      }
    

提交回复
热议问题