SharePoint 2016: How to Upload to a Document Library using JQuery/AJAX

MLEONKC 1 Reputation point
2021-11-09T17:37:21.327+00:00

I am on a closed network that cannot make calls to the outside world and I need to upload to a document library using JQuery. Anyone have some sample code I could look at?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,678 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,606 Reputation points Microsoft Vendor
    2021-11-10T02:49:24.897+00:00

    Hi @MLEONKC ,
    I will recommend to use the REST interface and jQuery AJAX requests to add a local file to the Documents library.
    Please refer to following document
    https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/upload-a-file-by-using-the-rest-api-and-jquery


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.