jboss7.x - How to limit multipart file upload size at jboss level? -
my application running on jboss as7+resteasy, handling file size limit in api as
@post @gzip @requestfilter @produces("application/json") @consumes("multipart/form-data") @path("/demo/test") public string uploadtest( @multipartform upfile uploadfilefile, ) { if (uploadfilefile.getfilesize() > 10*10*1024) { //error.. } }
where filesize @formparm, works me.
issue uploadtest() api gets called after file uploaded jboss container, , check file size takes unnecessarily server resources (say client uploads 1gb data data uploaded server) looking rejects files once exceed size of 10mb.
adding web.xml can you.
<multipart-config> <max-file-size>5120000</max-file-size> <max-request-size>5120000</max-request-size> </multipart-config>
Comments
Post a Comment