1

I use SOAP in native C++ application - no C#, no Java Script.
When renaming list item (including file) via REST, it's possible to alter Name field. But in case of using SOAP Lists.asmx UpdateListItems does not change neither FileLeafRef nor FileRef field though returns OK (I have tried all other possible fields from http://blogs.msdn.com/b/michael_yeager/archive/2008/11/03/reference-list-for-internal-field-names.aspx).

Changing BaseName field works but does not affect extension.

Is there a way to rename file together with extension?

1 Answer 1

1

It is unfortunately not possible to change a files extension by changing metadata. The file have to be moved or copied to a new file with correct extension.

Check /_vti_bin/copy.asmx and /_vti_bin/lists.asmx (you can delete items with UpdateListItems)

EDIT: You can move an item with the UpdateListItems in /_vti_bin/lists.asmx

<Batch OnError='Continue' RootFolder='/Shared Documents/'>
   <Method ID='1' Cmd='Move'>
      <Field Name='ID'>1</Field>
      <Field Name='FileRef'>/Shared Documents/MyFile.txt</Field>
      <Field Name='MoveNewUrl'>/Shared Documents/MyFolder/MyFile.txt</Field>
   </Method>
</Batch>

https://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.14).aspx

6

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.