是否可以限制图像库的大小
在共享点 2007 我们有一个图像库,它使用大约 2GB 的空间,
我们需要限制该库,一旦达到 2.5GB,就不允许用户添加更多图像,这在 sharePoint 中可能吗?如何实现?
请帮助
问候。
In sharepoint 2007
we have an image libraryy which is using around 2GB of space
we need to limit the library to not allow the user to add more images once it is 2.5 GB is that possible in sharePoint and how?
plz help
regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是开箱即用的。
您必须创建一个派生自 SPItemEventReceiver 的类,并且每次添加/删除/更新图像时检查当前大小。
达到阈值后,您可以更改列表上的权限。
或者,您可以在 ItemAdding 方法并设置
properties.Cancel = true
以防止达到阈值。我不知道最有效的方法是什么,因为每次添加新列表项时检查每个列表项的文件大小将会非常昂贵:
我想我只需将当前使用情况存储在 < 中的变量中a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.properties.aspx" rel="nofollow">SPList.RootFolder.Properties 并在项目事件接收器的 ItemAdded/ItemUpdated 方法。
Not out of the box.
You have to create a class that derives from SPItemEventReceiver and that checks the current size every time an image is added/deleted/updated.
Once the Threshold is reached you can change permissions on the list.
Alternatively, you can do that check in the ItemAdding method and set
properties.Cancel = true
in case the threshold is reached.I don't know off hand what the most efficient approach is since checking file sizes of each list item every time a new one is added is going to be expensive:
I think I'd just store the current usage in a variable in the SPList.RootFolder.Properties and update it in the ItemAdded/ItemUpdated methods of the Item Event Receiver.