Forum Discussion

Venkata_Kishore's avatar
Venkata_Kishore
Copper Contributor
Jul 12, 2021

Upload multiple files to list item in custom new form using SFPx react

Hi,

 

I am new to SPFx. I need to attach multiple files to new list item using SFPx. I am using 'List Item Attachments' PnP control to browse the files. 
https://pnp.github.io/sp-dev-fx-controls-react/controls/ListItemAttachments.html

 

I am able to upload only single file using this control. When I am selecting more than 1 files, the files are not attaching to the list item.

Below is the sample code given in the above url
listItemAttachmentsComponentReference.current.uploadAttachments(1); // Here 1 is the item Id.

 

I tried hard coding the item Id, but still it is not attached if the control contains more than 1 file.

 

Can you please help me on this. If you have any alternate with any other control to upload multiple attachments to new list item please let me know and share the reference url.

 

Thanks,

Kishore.

No RepliesBe the first to reply

Resources