So I'm trying to get the location of a document library, but I've become stuck on how to proceed. This is what I've got so far:
public string GetLibraryLocation()
{
var location = "";
SPSite siteCollection = SPContext.Current.Site;
var siteString = siteCollection.ToString();
//SPWebCollection collectionWebsites = siteCollection.AllWebs;
using (SPSite site = new SPSite(siteString))
{
using (SPWeb web = site.OpenWeb())
{
SPListCollection docLibCollection = web.GetListsOfType(SPBaseType.DocumentLibrary);
// Where to go from here..
}
}
return location;
}
What I'm trying to achieve is writing a method that can give me the location of the document library in the shape of an URL. With that URL, the plan is to obtain a folder residing in the library, which I'm then going to insert a file into. But I'm currently stuck on just obtaining the library URL. Any hints appreciated!