Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Upload files using REST API in SharePoint 2013

$
0
0

Hi,

I am trying to use the REST API to call the document library and upload the files. I have verified the MSDN and got the below code

url: http://site url/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files/add(url='a.txt',overwrite=true) method: POST body: "Contents of file" Headers: Authorization: "Bearer " + accessToken X-RequestDigest: form digest value content-length:length of post body

How we can call this code in the SharePoint page to upload the files. I am not sure how we need to get the "AccessToken" and to call this code in the sharepoint page.

If you have any sample code or reference link,please send it to me.

Thank you,

Mylsamy



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>