Link to home
Start Free TrialLog in
Avatar of Rog D
Rog DFlag for United States of America

asked on

How to Get SharePoint Library from Document Path

Using C# and CSOM I would like to get the SharePoint library a document belongs to using the Path or Hyperlink of that file.

I am sure this is possible, but could not find anything that showed an example.

Exmple Of Path:  http://uatecm.MyTestSite.com/repository/current/Test/MUSTREAD,%20FLOYD.pdf

I am using Microsoft.SharePoint.Client via a web application.

Thanks,

Roger
Avatar of Robert
Robert
Flag of United States of America image

In your example I believe "repository" would be the name of the document library.

That said the best way to find it is to go into your site contents (if you have rights to do so)
Avatar of Rog D

ASKER

I am looking for some code example that would allow me to pass in the full URL of the file then allow me know the Library where this file belongs to.

 http://uatecm.test.com/repository/current/Testing/MUSTREAD,%20FLOYD.pdf

Thanks,

Roger
ASKER CERTIFIED SOLUTION
Avatar of Robert
Robert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rog D

ASKER

I will use this solution for now as I expect the current path to always have the Library name in the same spot.

Thanks for the examples as well.