How to rename a file using SharePoint Web Services?

I have my own definition for a document library, and I'm trying to rename documents in the library using only web services out of the box. Having defined the view with the "Name" field provided and the "LinkFilename" attempt, my file rename calls return a failure or ignore the new value accordingly.

How to rename a file using SharePoint Web Services?

+4
source share
2 answers

Use the Lists.UpdateListItems web method. The XML request should look like this:

<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0"> <Method ID="1" Cmd="Update"> <!-- List item ID of document --> <Field Name="ID">2</Field> <!-- Full URL to document --> <Field Name="FileRef">http://Server/FullUrl/File.doc</Field> <!-- New filename --> <Field Name="BaseName">NewName</Field> </Method> </Batch> 
+10
source

You can use UpdateListItems . Here is an example .

For the comment: So, the actual question: "What can I call a web service?" Check out this example . A few more good hikes here .

0
source

Source: https://habr.com/ru/post/1286210/


All Articles