I need the users to be able to upload attachments. then i need to display the attachment so it can be selected and viewed.
sometimes there may only be a single attachment. sometimes multiple.
file type can be .xlsx,.xls,.doc, .docx,.ppt, .pptx,.txt,.pdf,.png, .jpg, .jpeg,.gif, .msg
right now im using this line of code in our react/typescript project
faqList.items.getById(addedFaq.data.Id).attachmentFiles.add(attachmentFiles![i].name, 'File added')
it currently uploads a single file (and i need to be able to upload multiple files). and when the file is retrieved and opened. it displays "File added". which is the text added at the end of the code snippet above.
So Im doing something wrong.
So can someone write an example of the proper code needed to upload multiple attachments to a sharepoint list and to retrieve those attachments without them being overwritten?
UPDATE: in the the documentation PNPJS ATTACHMENT DOCS In the example to add an attachment they use the following code
await item.attachmentFiles.add("file2.txt", "Here is my content");
But what is "Here is my content", what does that represent?