title: problem with spring ajax file upload
body: <p>I have a simple form with an option to upload image but to upload a file I am not using this method</p>
  
  <pre><code>&lt;form:input path="logoData" id="image" type="file" /&gt;
  </code></pre>
  
  <p>instead I am using <a href="http://valums.com/ajax-upload/" rel="nofollow">ajax upload jquery pulgin</a>.
  The problem is upload.parseRequest(request) is returning null in the below code :</p>
  
  <pre><code>@RequestMapping(value = "/upload.htm", method = RequestMethod.POST)
  public @ResponseBody String upload(HttpServletRequest request) throws FileUploadException{
  
      // Create a factory for disk-based file items
      FileItemFactory factory = new DiskFileItemFactory();
  
      // Create a new file upload handler
      ServletFileUpload upload = new ServletFileUpload(factory);
  
      // Parse the request
      List&lt;FileItem&gt; items = upload.parseRequest(request);
       System.out.println("====ITEMS====" + items.size());
  
  
       System.out.println("----REQUEST---" +request.getParameter("uploadImg"));
          System.out.println("-----SIZE----" +request.getParameterMap().size());
          Map&lt;String, String&gt; map = request.getParameterMap();
  
          for(Map.Entry&lt;String, String&gt; entry : map.entrySet()){
              System.out.println("----KEY---" + entry.getKey() + "----value---" + entry.getValue());
          }
  
  
   // Check that we have a file upload request
      boolean isMultipart = ServletFileUpload.isMultipartContent(request);
  
      System.out.println("----IS MULTIPART---" +isMultipart);
      return "hello";
  }
  </code></pre>
  
  <p>Output of log is : </p>
  
  <p>====ITEMS====0 <br/>
  ----REQUEST---null <br/>
  -----SIZE----0 <br/>
  ----IS MULTIPART---true <br/></p>
  
  <p>And my javascript code is :</p>
  
  <pre><code>new AjaxUpload('#upload', {
  action : my_url+ 'methodName/upload.htm',
  name : 'uploadImg',
  autoSubmit : true,
  responseType: 'html',
  onChange: function(file, extension){   },   
  onSubmit: function(file, extension) {
  
  },
  onComplete: function(file, html) {
      alert(file);
      alert(html);
  
  }
  </code></pre>
  
  <p>});</p>
  
  <p>IS MULTIPART is showing true but <strong>how to get the file name and how to store it</strong>. I have tried an example without ajax and it works fine using datatype CommonsMultipartFile.
  Also I have used ajaxupload in PHP and I get the filename as $_FILES['image']['name'] but no idea in java as I am new to java.
  I have followed my similar question on this site but no success.</p>
  
  <p>Thanks.</p>