[Plone-Users] Way to limit photo/image size uploaded by Member ?

classic Classic list List threaded Threaded
7 messages Options
Sean K Sean K
Reply | Threaded
Open this post in threaded view
|

[Plone-Users] Way to limit photo/image size uploaded by Member ?

I want to allow relatively unknown people to join the portal site and upload
photos (within the context of a custom object).  I would like to limit the
size of images they upload to prevent to much from getting added to zope
odb.  Are there ways to limit this for members only and allow administrator
unrestricted upload sizes ?

Other ways to handle it might be limit Member folder size or ?




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer Dieter Maurer
Reply | Threaded
Open this post in threaded view
|

Re: [Plone-Users] Way to limit photo/image size uploaded by Member ?

sean wrote at 2006-10-10 10:45 -0400:
>I want to allow relatively unknown people to join the portal site and upload
>photos (within the context of a custom object).  I would like to limit the
>size of images they upload to prevent to much from getting added to zope
>odb.  Are there ways to limit this for members only and allow administrator
>unrestricted upload sizes ?

New objects are created by the "PUT_factory" (defined by "PortalFolder").

Using your own "PortalFolder" (or changing "PUT_factory" by monkey patching)
allows you to implement a policy you want.

Unfortunately, this would work only for newly created objects
and not for later modifications. For this, you would need to
modify (monkey patch) the respective modification methods.



--
Dieter

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Marc Lindahl Marc Lindahl
Reply | Threaded
Open this post in threaded view
|

Re: Way to limit photo/image size uploaded by Member ?

In reply to this post by Sean K
They way I did that was run zope behind Squid, and use squid to limit  
the upload/download sizes.  Works like a charm.

On Oct 10, 2006, at 10:45 AM, sean wrote:

> I want to allow relatively unknown people to join the portal site and  
> upload
> photos (within the context of a custom object).  I would like to limit  
> the
> size of images they upload to prevent to much from getting added to  
> zope
> odb.  Are there ways to limit this for members only and allow  
> administrator
> unrestricted upload sizes ?
>
> Other ways to handle it might be limit Member folder size or ?
>
>
>
>
> -----------------------------------------------------------------------
> --
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Plone-Users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Jon Stahl Jon Stahl
Reply | Threaded
Open this post in threaded view
|

Re: [Plone-Users] Way to limit photo/image size uploaded by Member ?

In reply to this post by Sean K

sean-52 wrote
I want to allow relatively unknown people to join the portal site and upload
photos (within the context of a custom object).  I would like to limit the
size of images they upload to prevent to much from getting added to zope
odb.  Are there ways to limit this for members only and allow administrator
unrestricted upload sizes ?

Other ways to handle it might be limit Member folder size or ?
Sean,

You might check out Ploneboard, which limits the size of documents that can be attached to a message.  This feature was implemented by two Plone Framework Team members, Martin Aspeli and Wichert Akkerman, so it is probably done "right."

http://svn.plone.org/view/collective/Ploneboard
-----
Jon Stahl, Director of Web Solutions
ONE/Northwest - Online Networking for the Environment
http://www.onenw.org
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: Way to limit photo/image size uploaded by Member ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- --On 29. Dezember 2006 08:11:53 -0800 Jon Stahl <[hidden email]> wrote:

> Sean,
>
> You might check out Ploneboard, which limits the size of documents that
> can be attached to a message.  This feature was implemented by two Plone
> Framework Team members, Martin Aspeli and Wichert Akkerman, so it is
> probably done "right."
>

You must keep in mind that Zope stores all POST data (larger than 16KB or
so) within a temporary file first. So POSTing large amounts of data to Zope
might be used as a DOS attack. It's better to block such attacks within the
proxy.

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFFlUBsCJIWIbr9KYwRAsVfAKDliJmmxUZ5u++mxeZjrxD+4C2NggCgw+1q
UUnSouYgiYYd5WGCdGbpaiA=
=YhGi
-----END PGP SIGNATURE-----


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
justizin-2 justizin-2
Reply | Threaded
Open this post in threaded view
|

Re: Way to limit photo/image size uploaded by Member ?

In reply to this post by Marc Lindahl
Marc - care to contribute a bit of squid.conf-fu?

On 12/29/06, Marc Lindahl <[hidden email]> wrote:

> They way I did that was run zope behind Squid, and use squid to limit
> the upload/download sizes.  Works like a charm.
>
> On Oct 10, 2006, at 10:45 AM, sean wrote:
>
> > I want to allow relatively unknown people to join the portal site and
> > upload
> > photos (within the context of a custom object).  I would like to limit
> > the
> > size of images they upload to prevent to much from getting added to
> > zope
> > odb.  Are there ways to limit this for members only and allow
> > administrator
> > unrestricted upload sizes ?
> >
> > Other ways to handle it might be limit Member folder size or ?
> >
> >
> >
> >
> > -----------------------------------------------------------------------
> > --
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to
> > share your
> > opinions on IT & business topics through brief surveys -- and earn cash
> > http://www.techsay.com/default.php?
> > page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Plone-Users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/plone-users
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Plone-Users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users
>


--
Justizin, Independent Interactivity Architect
ACM SIGGRAPH SysMgr, Reporter
http://www.siggraph.org/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Marc Lindahl Marc Lindahl
Reply | Threaded
Open this post in threaded view
|

Re: Way to limit photo/image size uploaded by Member ?

Well there are a couple of squid-zope how-to's out there for the  
general setup... personally i used virtualhostmonster and used a socket  
of 127.0.0.1 to connect zope to squid.

#  TAG: request_body_max_size   (KB)
#       This specifies the maximum size for an HTTP request body.
#       In other words, the maximum size of a PUT/POST request.
#       A user who attempts to send a request with a body larger
#       than this limit receives an "Invalid Request" error message.
#       If you set this parameter to a zero, there will be no limit
#       imposed.
#request_body_max_size 1 MB

#  TAG: reply_body_max_size     (KB)
#       This option specifies the maximum size of a reply body.  It
#       can be used to prevent users from downloading very large files,
#       such as MP3's and movies.   The reply size is checked twice.
#       First when we get the reply headers, we check the
#       content-length value.  If the content length value exists and
#       is larger than this parameter, the request is denied and the
#       user receives an error message that says "the request or reply
#       is too large." If there is no content-length, and the reply
#       size exceeds this limit, the client's connection is just closed
#       and they will receive a partial reply.
#
#       NOTE: downstream caches probably can not detect a partial reply
#       if there is no content-length header, so they will cache
#       partial responses and give them out as hits.  You should NOT
#       use this option if you have downstream caches.
#
#       If you set this parameter to zero (the default), there will be
#       no limit imposed.
#reply_body_max_size 0


ref: http://www.visolve.com/squid/squid24s1/tuning.php



On Dec 29, 2006, at 11:29 AM, Justizin wrote:

> Marc - care to contribute a bit of squid.conf-fu?
>
> On 12/29/06, Marc Lindahl <[hidden email]> wrote:
>> They way I did that was run zope behind Squid, and use squid to limit
>> the upload/download sizes.  Works like a charm.
>>
>> On Oct 10, 2006, at 10:45 AM, sean wrote:
>>
>> > I want to allow relatively unknown people to join the portal site  
>> and
>> > upload
>> > photos (within the context of a custom object).  I would like to  
>> limit
>> > the
>> > size of images they upload to prevent to much from getting added to
>> > zope
>> > odb.  Are there ways to limit this for members only and allow
>> > administrator
>> > unrestricted upload sizes ?
>> >
>> > Other ways to handle it might be limit Member folder size or ?
>> >
>> >
>> >
>> >
>> >  
>> ----------------------------------------------------------------------
>> -
>> > --
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to
>> > share your
>> > opinions on IT & business topics through brief surveys -- and earn  
>> cash
>> > http://www.techsay.com/default.php?
>> > page=join.php&p=sourceforge&CID=DEVDEV
>> > _______________________________________________
>> > Plone-Users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>>
>> ----------------------------------------------------------------------
>> ---
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to  
>> share your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?
>> page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Plone-Users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>
>
> --
> Justizin, Independent Interactivity Architect
> ACM SIGGRAPH SysMgr, Reporter
> http://www.siggraph.org/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users