Announcement Announcement Module
No announcement yet.
File upload to AbstractCommandController - files not there Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • File upload to AbstractCommandController - files not there

    I have an AbstractCommandController and a command bean that binds 4 small files from a request successfully;

    however, a fifth file is too large for this tactic so I'm trying to access it using a CommonsMultipartResolver (and a MultipartHttpServletRequest derived from it).

    But the request is empty of any files! even though the other files were bound to the command object successfully! Does Spring strip these files from the request somewhere in the workflow? Any ideas?

        protected ModelAndView handle(HttpServletRequest request,
                HttpServletResponse response,
                Object command,
                BindException errors)
                throws Exception {
            String                      fNm;
            Iterator                    iter;
            try {
                MultipartHttpServletRequest multipartRequest;
                multipartRequest = multipartResolver.resolveMultipart(request);
                iter = multipartRequest.getFileNames();
                while (iter.hasNext()) {
                    fNm = (String);
                    System.out.println(" File = " + fNm);
            } catch (MultipartException pE) {
                System.out.println("   " + pE);
    The above code indicates an empty Request when ran (i.e. doesn't print anything to the console). :shock: