如何使用SharePoint Web服务重命名文件? [英] How do I rename a file using the SharePoint web services?

查看:117
本文介绍了如何使用SharePoint Web服务重命名文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对文档库有一个自定义定义,我试图仅使用现成的Web服务在库中重命名文档.定义了带有名称"字段的视图并尝试了"LinkFilename"后,我对文件重命名的调用分别返回失败或忽略新值.

I have a custom definition for a document library and I am trying to rename documents within the library using only the out of the box web services. Having defined a view with the "Name" field supplied and trying the "LinkFilename", my calls to rename a file are respectively returning a failure or ignoring the new value.

如何使用SharePoint Web服务重命名文件?

How do I rename a file using the SharePoint web services?

推荐答案

使用 Lists.UpdateListItems 网络方法. XML请求应如下所示:

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

<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>

这篇关于如何使用SharePoint Web服务重命名文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆