Upload attachment to SharePoint list using HTML form and JavaScript

Copper Contributor
Please anyone help on how to save the attachment to SharePoint list along with fields from HTML form and JavaScript. I am new to SharePoint. Please help with example
2 Replies

@Sriniaghalaya 

 

You can use SharePoint REST API to upload attachment to SharePoint list items. You have to use below endpoint to do this:

 

/_api/lists/GetByTitle('listName')/items(<itemId>)/AttachmentFiles/add(FileName='<file name with extension')

 

check below links for detailed information:

  1. Upload attachment to new item on list using REST API JQuery in SharePoint 2013 
  2. Uploading Attachments to SharePoint Lists Using REST 
  3. Add attachment to a list item using REST API 

Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

 

 

I am unable to achieve by the reference link provided. Please suggest me with details on how to achieve