title: ExtJS File upload response?
body: <p>I'm trying to validate the contents of some files through a web interface and use the response to enable / disable some other functionality ... like a save button. I've got as far as the submit and file handling (stubbed) but I cant seem to get my response to work properly. </p>
  
  <p>Problem : on response tries to make user download a file with the response contents. I want to just pass the response to the success function to be handled. </p>
  
  <p>JS Function Code: </p>
  
  <pre><code>function validateCopybook() {
          //submit values. 
          console.log("validating");
          if (this.getForm().isValid()) {
              this.getForm().submit({
              url : 'batch/validateCopybook.json',
              waitMsg : 'Validating...',
              success : function(form, action) {
                  this.msg('Success', 'Processed file on the server');
  
  
                  }
              });
          }
      }
  </code></pre>
  
  <p>Server side code : </p>
  
  <pre><code>public ModelAndView validateCopybook(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
      // Check whether we're dealing with a multipart request
      String contentHeader = request.getHeader("content-type");
      boolean isMultipart = (contentHeader != null &amp;&amp; contentHeader.indexOf("multipart/form-data") != -1);
  
      if (isMultipart == false)
      {
          return Helper.errorResponse("not multipart");
      }
      else
      {
          DefaultMultipartHttpServletRequest reqM = (DefaultMultipartHttpServletRequest) request;
          MultiValueMap&lt;String, MultipartFile&gt; fileMap = reqM.getMultiFileMap();
          MultipartFile copyIn = fileMap.get("copy-path-in").get(0);
          MultipartFile copyOut = fileMap.get("copy-path-out").get(0);
      }
  
      System.out.println(response.getContentType());
      response.setContentType("application/json");
  
      ModelAndView mav = Helper.successResponse("success");
      return mav;
  }
  </code></pre>
  
  <p>Response returned : </p>
  
  <pre><code>ModelAndView: reference to view with name 'json'; model is {model={data={"success":true,"info":"success","dataLength":0,"data":[]}}}
  </code></pre>
  
  <p>Any ideas ? </p>