在“ FileReader”上获取“ readAsArrayBuffer”:尝试使用FileReader时参数1的类型不是“ Blob”

时间:2020-11-04 18:49:20

标签: sharepoint-online spfx

使用以下内容作为附件提交到SharePoint列表项时,出现此错误。 enter image description here

const { filePicked } = this.state;
      
  if (filePicked) {
    let targetList: IList = sp.web.lists.getByTitle('PanelMeetings');
    let selectedFile = filePicked.downloadFileContent();

    let reader = new FileReader();
                   
     reader.readAsArrayBuffer(selectedFile);
        
     reader.onload = () => {
        
           targetList.items.getById(r.data.Id).attachmentFiles.add(filePicked.fileName, reader.result);
       this.setState({
         message: 'Attachment Successfully added'
         });
         };
        }

我已阅读:https://en.it1352.com/article/fe83588ba22a46fa8c16676cc29ec66a.html 但这并没有全面详细地说明确切的问题。 有人可以告诉我我在做什么错吗?

0 个答案:

没有答案