1

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

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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