title: File upload with ServletFileUpload's parseRequest?
body: <p>I upload the file which I browse with <code>input type="file"</code> in my web App. The issue is I  get the <code>FileItem</code> list size as 0 though I can see all uploaded file info  under  </p>
  
  <p><code>request</code> -> <code>JakartaMutltiPartRequest</code> -> files attribute</p>
  
  <p>Here is java code that reads the file </p>
  
  <pre><code>public InputStream parseRequestStreamWithApache(HttpServletRequest request)
    throws FileUploadException, IOException {
    InputStream is = null;
    FileItemFactory factory = new DiskFileItemFactory();
    ServletFileUpload upload = new ServletFileUpload(factory);
    List items = upload.parseRequest(request);
    // here the item size is 0 ,i am not sure why i am not getting my file upload in browser with type="file"
    // but If inspect request in debugger i can see my file realted info in request---&gt;JakartaMutltiPartRequest-----&gt;files attribute
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
      FileItem item = (FileItem) iter.next();
  
      if (!item.isFormField()) {
        is = item.getInputStream();
      }
    }
  
    return is;
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>Here is JSP part:</strong></p>
  
  <pre><code>&lt;form NAME="form1" action="customer/customerManager!parseRequestStreamWithApache.action" ENCTYPE="multipart/form-data"   method="post" &gt;
       &lt;TABLE &gt;
           &lt;tr&gt;
                &lt;th&gt;Upload File&lt;/th&gt;
                    &lt;td&gt;
                     &lt;input name="fileUploadAttr" id="filePath"  type="file" value=""&gt;
                   &lt;/td&gt;
                    &lt;td &gt; 
                   &lt;Input type="submit" value ="uploadFile"/&gt;
                    &lt;/td&gt;
            &lt;/tr&gt;
      &lt;/TABLE&gt;
  &lt;/form&gt;
  </code></pre>