spweb

SharePoint, how do you programatically determine the storage size of a SPWeb?

我是研究僧i 提交于 2019-12-10 05:46:41
问题 Not of the site collection itself, but the individual SPWeb's. 回答1: You should take a look at this blog entry by Alexander Meijers : Size of SPWeb based on its Folders and Files It provides a clever way of finding the size of an SPWeb or SPFolder by iterating through his content. private long GetWebSize(SPWeb web) { long total = 0; foreach (SPFolder folder in web.Folders) { total += GetFolderSize(folder); } foreach (SPWeb subweb in web.Webs) { total += GetWebSize(subweb); subweb.Dispose(); }

SharePoint, how do you programatically determine the storage size of a SPWeb?

我的未来我决定 提交于 2019-12-05 11:04:16
Not of the site collection itself, but the individual SPWeb's. You should take a look at this blog entry by Alexander Meijers : Size of SPWeb based on its Folders and Files It provides a clever way of finding the size of an SPWeb or SPFolder by iterating through his content. private long GetWebSize(SPWeb web) { long total = 0; foreach (SPFolder folder in web.Folders) { total += GetFolderSize(folder); } foreach (SPWeb subweb in web.Webs) { total += GetWebSize(subweb); subweb.Dispose(); } return total; } For anyone who comes back to this question, here is the missing method: private long

Best Pattern for AllowUnsafeUpdates

廉价感情. 提交于 2019-11-30 12:09:04
问题 So far, in my research I have seen that it is unwise to set AllowUnsafeUpdates on GET request operation to avoid cross site scripting. But, if it is required to allow this, what is the proper way to handle the situation to mitigate any exposure? Here is my best first guess on a reliable pattern if you absolutely need to allow web or site updates on a GET request. Best Practice? protected override void OnLoad(System.EventArgs e) { if(Request.HttpMethod == "POST") { SPUtility.ValidateFormDigest