How to use the return value from FilePicker to add to a SharePoint list item attachment, using @pnp

Brass Contributor

I'm getting this error when using the below to submit to a SharePoint list item as an attachment.


I'm using this method:


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

    let reader = new FileReader();
     reader.onload = () => {
           targetList.items.getById(, reader.result);
         message: 'Attachment Successfully added'


I've read this: But it's not detailing the exact problem comprehensively enough. Can someone tell me what I'm doing wrong here?


0 Replies