Hi for the development purpose in development environment i want to get minimum and maximum file size uploaded in each document library per month in a site,how can i get this?

there is many folders in side a document library and each folder has 2000 documents and I want to get max and min uploaded documents per month

  • Why you require query on database to get file size of each document? – Viraj Gorajia Nov 21 '16 at 9:57
  • There is many document libraries and more number of documents in each document library – adilahmed Nov 21 '16 at 11:05
  • I want to get uploaded documents per month – adilahmed Nov 21 '16 at 11:14

If you are doing server side code, below code will be useful for you:

SPSiteDataQuery query = new SPSiteDataQuery();
query.Webs = "<Webs Scope=\"Site\">";
query.Lists = "<Lists BaseType=\"1\" />";
query.ViewFields = "<FieldRef Name=\"LinkFilename\" /><FieldRef Name=\"FileSizeDisplay\" />";
DataTable dtLibs = web.GetSiteData(query);
  • hi how i use this query? – adilahmed Nov 21 '16 at 11:05
  • This is server side code. You have to create webpart or layout page – Viraj Gorajia Nov 21 '16 at 11:33
  • It will get all documents from all document libraries of site in datatable . – Viraj Gorajia Nov 21 '16 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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