Problem With servlet getContentLength()
Hi,
I am using sun one application server 7.0 i am writing an application for uploading files. I want to restrict the uploading size. I am testing this with request.getContentLength() method. Which is working on Tomcat but failing on sun one when file upload size is more than 1MB.
My code fragment is like this:
if(request.getContentLength() > fileLimit){
log.warn(" Upload size is more than file Limit");//Line 1
request.getReguestDispatcher("/upload.jsp").forward(req,res); //Line 2
}
I am getting page not found in the browser.
i replaced line2 with getServletContext().getReqDisp().forward() method and also with out.println(), same result.
is there any workaround for this??
Any suggestion!? Thanks in advance!!
|