No it should be per request.  So somewhere at the beginning of the servlet
that handles the fileupload you would do:

if ( administrator ) {
    setAttribute("caucho.multipart.form.upload-max", new Long (300000) );
} else {
    setAttribute("caucho.multipart.form.upload-max", new Long (10000) );
}

Obviously you have to replace "administrator" in the "if" with the logic
that tells you whether the person is an administrator or not.  For example
if you are using HTTP AUTH then you would do something like:

if( req.isUserInRole('administrator') ) {
    setAttribute("caucho.multipart.form.upload-max", new Long (300000) );
} else {
    setAttribute("caucho.multipart.form.upload-max", new Long (10000) );
}

Aaron


> -----Original Message-----
> From: resin-interest-boun...@caucho.com [mailto:resin-interest-
> boun...@caucho.com] On Behalf Of Riccardo Cohen
> Sent: Tuesday, February 10, 2009 11:23 AM
> To: General Discussion for the Resin application server
> Subject: Re: [Resin-interest] upload limit
> 
> I answer to these uploads with a servlet in java.
> The setting you suggest will apply for all sessions
> Am I right ?
> But I want to limit differently if it is the public or if it is the
> administrator of the application.
> 
> Aaron Freeman wrote:
> >> Hi
> >> For one of my project I have to set <multipart-form enable='true'
> >> upload-max='300M'/>
> >>
> >> I guess this is a security problem, and I would rather let it to
> 100K
> >> except for the application administrator session where I would set
> >> dynamically to 300M.
> >
> >
> > Riccardo are you using a JSP to process the file?  If so, according
> to this:
> >
> >
> > https://www.gopay.com.cn/resin-doc/config/webapp.xtp#multipart-form
> >
> > you can set a request attribute at run time,
> > caucho.multipart.form.upload-max to override the maximum file size.
> >
> > Aaron
> >
> >
> >
> >
> > _______________________________________________
> > resin-interest mailing list
> > resin-interest@caucho.com
> > http://maillist.caucho.com/mailman/listinfo/resin-interest
> >
> >
> 
> --
> Riccardo Cohen
> Architecte du Logiciel
> http://www.architectedulogiciel.fr
> +33 (0)6.09.83.64.49
> 
> 
> 
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to