Nov 05 2020 01:06 AM
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.readAsArrayBuffer(selectedFile);
reader.onload = () => {
targetList.items.getById(r.data.Id).attachmentFiles.add(filePicked.fileName, reader.result);
this.setState({
message: 'Attachment Successfully added'
});
};
}
I've read this: https://en.it1352.com/article/fe83588ba22a46fa8c16676cc29ec66a.html But it's not detailing the exact problem comprehensively enough. Can someone tell me what I'm doing wrong here?