How to create a document library under a parent libray by api
Hi all,
I am working with sitefinity 7.0.
I am working on creating and uploading document to library by api in sitefinity.
Suppose I have 2 document libraries say Group1,Group2 under the root
Default Library.
How can i upload documents to the library Group1,Group2 under the Default Library.
I am referring the code here .
//Set the parent document library.
DocumentLibrary documentLibrary = librariesManager.GetDocumentLibraries().Where(d => d.Id == parentDocumentLibraryId).SingleOrDefault();
document.Parent = documentLibrary;
But how can i found the Id of the document library Group1 under Default Library by its name?
because the librariesManager.GetDocumentLibraries() returns only libraries in root level.
What i need is the documentLibrary which has name Group1 under parent Default Library.
Any way to achieve this?
Thanks
Hello,
When working in the context of hierarchical libraries, only the libraries on the root level are referred to as libraries. Their children are folders(http://docs.sitefinity.com/for-developers-library-folders). To get all folders in a parent library/folder, you can use the approach described here:http://docs.sitefinity.com/for-developers-get-folders.
Regards,
Atanas Valchev
Telerik