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

查看:24
本文介绍了如何使用 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 网络服务重命名文件?

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天全站免登陆