crosspost: https://orchard.codeplex.com/discussions/456226
In Orchard, each site (whether or not you enable multitenancy) seems to have it's own Folder within Media (main file folder for Orchard). I want to get the entire filesize of a current site (ergo, the folder under Media).
I've digged into the Framework and got into FileSystemStorageProvider
which seems to be promising with the FileSystemStorageFolder
class and GetSize()
method.
However, I was wondering if anyone else checked this out before I go into experimenting with that class.
Any piece of information or advise would be highly apreciated. Thanks!
Didn't really find an easy way to do it but copied mostly from the Orchard framework. You will need the following:
And then you need to define the Site Storage Path:
Finally, here is my function to compute the storage for a specific folder (in this case, the tenant's/site's root media folder):
This returns a double for the MB used. Hope this helps someone :)