A few things that might be worth checking for:
- Is the doPost() method the same as that of the servlet "AServlet" referred to in the form? This is primarily to ensure that the request has not already been read, in which case parsing of the request into FileItem objects will not happen. A request once parsed, cannot be parsed again by Commons FileUpload; usually the presence of servlets and filters upstream is responsible for this condition.
- Is the form submit actually working? And does the issue recur with different files? Ideally, the Commons Fileupload component will not return any more items when the End Of File condition has been reached, i.e. there is no more data to read (the number of bytes in content-length header has been read from the body).
PS: It might be better to use the Logger class to be 'doubly sure' on whether the Form and File field parsing is being done or not.