简体   繁体   English

使用sharepoint文档ID获取文档名称

[英]get document name using sharepoint document id

I have a document ID for the file I want to download, How can I resolve the Id to a document name? 我有要下载的文件的文档ID,如何将ID解析为文档名称? If I do this I can add it to the url and use the full string to download the file. 如果执行此操作,则可以将其添加到url中,并使用完整的字符串下载文件。 Thanks in advance! 提前致谢! ps I cant use client side object model ps我不能使用客户端对象模型

I was under the impression Document ID, would be the id for a document which could be in any document library within that site collection. 我印象很深,“文档ID”将是该文档的ID,该ID可以在该网站集中的任何文档库中。 So it would not be possible to work out which list/library it was in. 因此,不可能计算出它所在的列表/库。

My suggestion is to use search. 我的建议是使用搜索。 Below is an example, should be able to change this so it query was the document id. 下面是一个示例,应该可以更改它,以便它查询的是文档ID。 http://www.codeproject.com/Tips/396184/SharePoint-2010-Search-Documents-Programmatically http://www.codeproject.com/Tips/396184/SharePoint-2010-Search-Documents-Programmatically

You can use GetList()to access the document library and get the name of the library. 您可以使用GetList()访问文档库并获取库的名称。 Please refer http://msdn.microsoft.com/en-us/library/websvclists.lists.getlist.aspx 请参考http://msdn.microsoft.com/en-us/library/websvclists.lists.getlist.aspx

I figured out a solution to my problem. 我想出了解决问题的办法。 using CAML and the Getlist() service provided by sharepoint I was able to take a document Id (from the top level) resolve it to a document and use the metaddate returned as xml to identify the following ( document name, document extension, FQDomain and more) Thusly, I was able to use the domain to download the file dynamically by parsing the xml attributes. 使用sharepoint提供的CAML和Getlist()服务,我能够(从顶层)获取文档ID(从顶级将其解析为文档),并使用以xml返回的metaddate标识以下内容(文档名称,文档扩展名,FQDomain和更多)因此,我能够通过解析xml属性使用域来动态下载文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM