SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently in the process of trying to upload a file from using SharePoint 2013 Restful Service as well as setting the fields in the same document library at the same time.

I have had success upload a file to SharePoint 2013 but setting the field values seems to be a problem

http://<site url>/_api/web/GetFolderByServerRelativeUrl(
  '/Shared Documents')/Files/add(url='a.txt',overwrite=true)

Is there a way to set the field values and upload a file at the same time with out resorting to SOAP

share|improve this question

No. First you need to upload the file. Then you need to get the list item associated with the new file. Then you can update the field values for the list item. So, it's a minimum of three service calls.

UPDATE (May 30, 2015): The REST API in SharePoint Online now supports batching so you can upload the file and set properties in the same service call. The answer above remains unchanged for SharePoint 2013 on-premises

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.