Hi,
Is there any way to get the library name in the SP.web.getFileByUrl.
I have tried the below code but not getting library name
C#
let result = await sp.web.getFileByUrl("https://sample.sharepoint.com/:p:/r/sites/SampleSite/SampleLibrary/test/test.docx?d=w1db9f77e26354f7e8301ff3ddda7dff0&csf=1&web=1&e=O2hf6u").select("*").get()
Vaibhav ChauhanRank #963 · 2.1K reputationPosted Jun 15, 2021, 12:24 AM EDT
Vaibhav ChauhanRank #963 · 2.1K reputationPosted Jun 14, 2021, 11:11 AM EDT
You can use below code to fetch library details
let libraryDetails = await sp.web.getList(ServerRelativeUrl).select("*").get();
console(libraryDetails.Title) ;
parthasarathy BRank #1,732 · 874 reputationPosted Jun 15, 2021, 12:15 AM EDT