Share via

Adding File to Document Library using SPServices/Jquery/REST API

Anonymous
2023-05-01T17:28:34+00:00

How would I utilize SPServices to add a new item to a document library?

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-05-03T05:48:09+00:00

    Dear TheodoreL,

    Yes, it is.

    Thanks for your effort and time!

    Sincerely,

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-05-02T11:42:19+00:00

    Thanks!

    // Define the folder path for this example.

    var serverRelativeUrlToFolder = '/shared documents';

    So in the code above, is "shared documents" the name of the document library it is going to?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-05-02T03:45:34+00:00

    Dear TheodoreL,

    The simplest way to upload a file to use the Upload option in the site library or go to http://site/_layouts/Upload.aspx?List={ID to the library} to upload the files.

    To use Rest API and jQuery, you may also create a Upload button by HTML code. To insert the code on a modern page, you may use the modern script editor web part.

    You may follow the steps in SharePoint | Online | Best Practice | install Modern Script Editor Web Part for SharePoint Online Modern Site. (microsoft.com) to deploy the web part in your tenant first.

    Then you can follow the steps in Upload a file by using the REST API and jQuery | Microsoft Learn to upload a file by using Rest API and jQuery.

    May I know whether you have some specific requirement by using jQuery and Rest API?

    Another simpler way to upload a file to SharePoint Online may be to use PowerApps and Power Automate if you want to deploy a customized solution in your tenant.

    Thanks for your effort and time!

    Sincerely,

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments