如何使用 CopyIntoItems 将文件复制到现有的 doclib 项目中

发布于 2024-09-25 07:41:46 字数 391 浏览 1 评论 0原文

这是我的场景:我需要使用其 Web 服务将文件复制到共享点文档库并在其上设置元数据。除了 Lookup 字段之外,这一切都可以通过 CopyIntoItems(来自 Copy webservice)实现。 CopyIntoItems 会忽略它们,因此我需要另一种方法来设置这些字段的数据。

我尝试使用必填字段和查找字段元数据创建一个列表项,然后使用项目 ID(使用 ID 创建 FieldInformation 字段以及其他一些简单元数据),调用 CopyIntoItems 方法,而不是更新该项目,sharepoint 创建了一个新项目。

我无法以相反的顺序执行此操作,因为我无法从 CopyIntoItems 创建的项目中获取 ID...

所以,问题是:如何将文件上传到共享点文档库并设置其所有元数据?包括查找字段。

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.

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.

I can't do this in the reverse order because i have no way to get the ID from the item created by CopyIntoItems...

So, the question is: How can i upload a file to a sharepoint document library and set all its metadata? Including Lookup fields.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

音盲 2024-10-02 07:41:46
  1. 使用常规 PUT WebRequest将文档上传到库中
  2. 查询文档库以查找您刚刚上传的项目的 ID(基于路径)
  3. 使用 Lists.asmx Web 服务 用于更新文档元数据

有用链接:将文件上传到 SharePoint 文档库并更新任何元数据列

  1. Use a regular PUT WebRequest to to upload the document into the library
  2. Query the document library to find the ID of the item you just uploaded (based on path)
  3. Use the Lists.asmx web service to update the document metadata

Helpful link: Uploading files to the SharePoint Document Library and updating any metadata columns

青朷 2024-10-02 07:41:46

请记住,如果目标文件夹项目计数 + 祖先文件夹项目计数超过列表视图阈值,则您无法查询列表中的 ID(Kit 答案中的步骤 2)。

如果将查询限制在文件夹层次结构中的特定分支,则可以更有效地完成查询。解决方法是修改站点设置,但查询会很缓慢,并且会降低解决方案的可移植性,因为 Office365 和 BPOS 的阈值无法更改。

这更好地解释了它: http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/create-or-delete-a-folder-in -a-列表或库-HA102771961.aspx

Keep in mind that if the destination folder item count + the ancestor folders item count exceeds the list view threshold then you can't query the list for the id (step 2 from Kit's answer).

Queries can be done more efficiently if constrained to a particular branch in the folder hierarchy. A workaround would be to modify the site settings, but the queries would be sluggish and would make the solution less portable because the threshold for Office365 and BPOS can't be changed.

This explains it much better: http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/create-or-delete-a-folder-in-a-list-or-library-HA102771961.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文