简体   繁体   中英

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? If I do this I can add it to the url and use the full string to download the file. Thanks in advance! ps I cant use client side object model

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. 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. 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. Please refer 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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