I have a problem with uploading of big files.
I have simple html form on client side.
On server side a have a servlet that processes multipart requests with commons-fileupload library. I set max request size :
So, if the file is too bigCode Java:
DiskFileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); upload.setSizeMax(maxRequestSize); upload.setFileSizeMax(maxRequestSize);
throws an exception.Code Java:
The problem is:
When uploaded file is too big servlet throws SizeLimitExceededException and finishes his work very quickly but on client side form submit continues and I have to wait several minutes until it ends. Why this is happened? And how can I cancel client form submit when servlet throws an exception?
I use JBoss 4.2.3 and commons-fileupload-1.2.2.
Thanks in advance