如何使用CopyIntoItems将文件复制到现有doclib项目中 [英] How to use CopyIntoItems to copy files into existing doclib items
问题描述
这是我的情况:我需要使用其Web服务将文件复制到共享点文档库,并在其上设置元数据.使用CopyIntoItems(来自复制" Webservice),除了查找"字段外,所有这些都是可能的. CopyIntoItems会忽略它们,因此我需要另一种在这些字段上设置数据的方法.
This is my scenario: I need to copy files to a sharepoint document library using its web services and set metadata on them. That's all possible with CopyIntoItems (from Copy webservice) except for Lookup fields. CopyIntoItems ignores them, so i need another way to set data on those fields.
我尝试创建带有必填字段和查找字段元数据的列表项,然后使用项目ID(创建具有ID的FieldInformation字段以及其他一些简单的元数据)称为CopyIntoItems方法,共享点创建了一个新项,而不是更新该项.
I've tried to create a list item with the mandatory and lookup fields metadata and then, using the item ID (creating a FieldInformation field with the ID, as well as some other simple metadata), called the CopyIntoItems method and, instead of updating the item, sharepoint created a new one.
我无法以相反的顺序执行此操作,因为我无法从CopyIntoItems创建的项目中获取ID ...
I can't do this in the reverse order because i have no way to get the ID from the item created by CopyIntoItems...
因此,问题是:如何将文件上传到Sharepoint文档库并设置其所有元数据?包括查找字段.
So, the question is: How can i upload a file to a sharepoint document library and set all its metadata? Including Lookup fields.
推荐答案
- 使用常规PUT
WebRequest
来将文档上传到图书馆 - 查询文档库以查找刚刚上传的商品的ID(基于路径)
- 使用 Lists.asmx网站服务以更新文档元数据
- Use a regular PUT
WebRequest
to to upload the document into the library - Query the document library to find the ID of the item you just uploaded (based on path)
- Use the Lists.asmx web service to update the document metadata
有用的链接:将文件上传到SharePoint文档库并更新任何元数据列
这篇关于如何使用CopyIntoItems将文件复制到现有doclib项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!