In the previous article, we have seen how to explore multiple attachments to the new item on a list using JSOM and REST API. In this article, we will see how we can upload the documents to SharePoint list items using REST API based approach.
Introduction
In the previous article, we have explored multiple attachments to the new item on a list using JSOM and REST API. In this article, we will see how we can upload the documents to SharePoint list items using REST API based approach.
So far, I have seen everyone blogging and posting articles, where they follow the approach of hardcoding the item ID and passing it to REST API and Uploading. But In this article, we will create a new item and that item ID, we have attached in the attachment.
Steps
The below code snippet will show the Personal Details HTML that has been created for the user to insert data into the list. In HTML, one tag is highlighted to facilitate multi-file upload control. I am leveraging "jquery.multifile.js" plugin. If we don't use that plugin, the user will be able to select only one input file for upload only one file at a time.
Step 1 Navigate to your SharePoint 2013 site. Step 2 From this page, select Site Actions | Edit Page. Edit the page, go to the Insert tab in the ribbon, and click Web Part option. In Web Parts picker area, go to the "Media and Content" category, select the "Script Editor Web Part", and press the "Add" button. Step 3 Once the Web Part is inserted into the page, you will see an "EDIT SNIPPET" link; click it. You can insert HTML and/or JavaScript, as shown below.
Final O/P
Getting Started With Workflow Manager Installation Guide