users@glassfish.java.net

file upload problem with 3.1.2

From: Cam Bazz <cambazz_at_gmail.com>
Date: Thu, 15 Mar 2012 10:33:24 +0200

Hello,

I have upgraded my application to GF3.1.2 and suddenly my fileupload
servlets are no longer working. Maybe it is because I am doing the
upload with old old code, or maybe not.

any ideas on this are greatly appreciated.

Best regards,
C.A.

        boolean isMultiPart = ServletFileUpload.isMultipartContent(request);
        if (isMultiPart) {

            ServletFileUpload upload = new ServletFileUpload();
            upload.setFileSizeMax(max_file_size);
            upload.setSizeMax(max_file_size);

            // Parse the request
            FileItemStream fistream = null;
            FileItemIterator iter = null;
            try {
                iter = upload.getItemIterator(request);
                //skip form fields
                while (iter.hasNext()) { <---- it never has next.
                    FileItemStream item = iter.next();