How to set file and image size limits in a ZEO cluster environment
by Nguyen, T. Kim — last modified Nov 22, 2009 09:04 AMusing plone.recipe.atcontenttypes
Background Info
You want to limit the size of files that can be added to your site. You want to limit the size of images (file size as well as width/height dimensions).
See
- http://pypi.python.org/pypi/plone.recipe.atcontenttypes
- http://keeshink.blogspot.com/2009/09/how-to-limit-file-upload-size.html
These links describe how to set it up in a zinstance / standalone install.
Plone Version Compatibility
So far it seems that this does not work with Plone 2.5, where it resulted in a KeyError: 'global_defines' in rendering the main_template.
It has worked for us with Plone 3.0, 3.1, and 3.2. We have not tested other versions.
Setup for a ZEO Cluster
Here we run ZEO cluster installations with sometimes up to five ZEO clients (so far).
This is what you will want to add to the parts section of your buildout.cfg. You need one "atcontenttypes" part per ZEO client. In this example we have five ZEO clients:
atcontenttypes-client1 atcontenttypes-client2 atcontenttypes-client3 atcontenttypes-client4 atcontenttypes-client5so your parts section will end up looking something like this:
parts = plone zope2 productdistros zeoserver client1 .. atcontenttypes-client1 atcontenttypes-client2 atcontenttypes-client3 atcontenttypes-client4 atcontenttypes-client5Then somewhere else, maybe at the end of buildout.cfg add this:
Only the atcontenttypes-client1 section specifies the size limits; the other atcontenttypes sections for clients 2 through 5 use the limits set for client 1.
Instead, you could specify different limits for each client. That could be useful if you wanted certain users using a specific client to be able to have higher or no limits at all.
original em : How to set file and image size limits in a ZEO cluster environment
Comentários