1

Please help me to compute document library size in sharepoint ?

Regards, Shiva Reddy.p

2 Answers 2

2

Taken from: http://sridharu.blogspot.com/2009/02/sharepoint-document-library-size.html

using (SPSite site = new SPSite("http://servername"))
{
   DataTable tbl;
   tbl = site.StorageManagementInformation(
   SPSite.StorageManagementInformationType.DocumentLibrary, 
   SPSite.StorageManagementSortOrder.Decreasing,
   SPSite.StorageManagementSortedOn.Size, 100);
   foreach (DataRow row in tbl.Rows)
   {
      foreach (DataColumn column in tbl.Columns)
      MessageBox.Show("Doc Lib Name :" + row["Title"].ToString() + "  Size (bytes): " + row["Size"].ToString());
   }
}
1
  • Thanks Brain , i got same solution. The above code will give the document library size..
    – shivareddy
    Oct 11, 2010 at 8:36
2

Try space monitor (http://www.thesug.org/Blogs/lsuslinky/Lists/Posts/ViewPost.aspx?ID=33&RootFolder=%2FBlogs%2Flsuslinky%2FLists%2FPosts) a great free tool to analyse storage used by your entire site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.