How to create a List that counts files in a folder

Hi Experts,

I tried to create a view of folder in a document library which would do a count of files in a folder but it didn't work out, basically I need to list the folders in the library and in one column a count of all files inside the folder and another column with total size of folder (with its files)

It sounds easy even to me but couldn't figure this out

Thanks in advance
SamooramadAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlMothanaAlOmariCommented:
Hi , i didn't get your Question ?  what do you want to do ? if you mean that you want to create a folder in a document library list , and to add items into this folder , do the following
If the list or library is not already open, click its name on the Quick Launch. On the New menu , click New Folder.
sometimes by default "New folder " is disable , to enable it go to list settings -->under Genral settings slsect advance settings
in the advance settings page , folder section select yes in the "Display "New Folder" command on the New menu? "
check the attached image
 

NewFolder.jpg
0
SamooramadAuthor Commented:
Hi, sorry for not being clear, I have a document library in SharePoint, it has multiple folders for each Division, say HR, IT , Operation, Finance...etc, each department has a number of files in their respective folders, I would like to have a view (if possible) that will list the root folders (the division folders) and next to the name of the folder have a column which counts the number of files in THAT folder only and its size

Is that clear? so for example:

Folder                   No. of Files                  Size
HR                               43                            2MB
Finance                       12                            6MB

as an example
Thanks
0
AlMothanaAlOmariCommented:
ok , this is not out of the box in sharepoint , what you should do  is to write a custom code (web part ) to read form list folders and to retrive the # of files inside each folder
use this links
http://mundeep.wordpress.com/2009/02/24/checking-if-a-spfolder-exists/ 
http://msdn.microsoft.com/en-us/library/dd587263(office.11).aspx 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

SamooramadAuthor Commented:
ok great, that answers my question about how to get the number of files in a folder, but once I get this how can I display them in column or create a view with this information to be displayed to users?
0
MsShadowCommented:
Create a list with two columns, title and amount.

Then use this piece of code to add items to the list:
http://msdn.microsoft.com/en-us/library/ms467435.aspx
0
SamooramadAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.