1
votes

In Liferay Portal 6.2, I have created an organization with a site where users of that organization can upload and share documents & media. I would like to limit the amount of storage space each organization is allowed to allocate for its documents.

For example, say Company A is an organization. I want only 512 MB alloted to the organization for documents & media. When the users of Company A uploads files and the limit of 512 MB is reached, no further documents can be uploaded.

Can this be done in Liferay Portal?

2
This forum post talks about Document Library Quota Hook. Unfortunately I was not able to find it, but maybe the hint will help.Tomas Pinos
I replaced memory with storage in your original post - memory is usually associated with RAM.Tobias Liefke

2 Answers

3
votes

You can create a Model Listener in which every time a new document is uploaded you store its weight in an organization document weight counter on the DB (you can create a new entity with its own service). If counter + new document's weight > 512 MB you can stop the upload.

Obviously, you should manage update and delete of documents too.

1
votes

I don't think this can be done with a Liferay out of the box installation. However it should be an easy customization.

An other option is to limit the space for certain folders in the Documents and Media Library at an OS level. But the customization offers a way more flexible solution.