title: Can't get file name? Always null
body: <p>HTML</p>
  
  <pre><code>                        &lt;form enctype="multipart/form-data" method="post" action="addCompany"&gt;
                              &lt;fieldset&gt;
                                  &lt;legend&gt;Add Company&lt;/legend&gt;
                                  &lt;br/&gt;
                                  &lt;label&gt;Company Name:&lt;/label&gt;
                                  &lt;input name="name" size="30" type="text"/&gt;
                                  &lt;br/&gt;
                                  &lt;label&gt;Company Logo:&lt;/label&gt;
                                  &lt;input name="file" size="30" type="file"/&gt;
                                  &lt;br/&gt;
                                  &lt;span id="updateError" class="errorMessage"&gt;&lt;/span&gt;
                                  &lt;button type="submit" class="jUiButton"&gt;Submit&lt;/button&gt;
                              &lt;/fieldset&gt;
                          &lt;/form&gt;     
                          &lt;script&gt;$(".jUiButton").button()&lt;/script&gt;
  </code></pre>
  
  <p>Java Servlet</p>
  
  <pre><code>// Check that we have a file upload request
          boolean isMultipart = ServletFileUpload.isMultipartContent(request);
          if(isMultipart &amp;&amp; request.getContentType() != null)
          {
              // 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 /* FileItem */ items = null;
              try
              {
                  items = upload.parseRequest(request);
              }
              catch(FileUploadException e) {}
  
              // Process the uploaded items
              Iterator iter = items.iterator();
  
              FileItem cvFile = null;
              while(iter.hasNext())
              {
                  FileItem item = (FileItem)iter.next();
  
                  if(item.isFormField())
                  {
                      if(item.getFieldName().equals("name"))
                          name = item.getString();
                  }
                  else
                  {
                      cvFile = item;
                  }
  
                  if(name != null &amp;&amp; cvFile != null)
                  {
                      directoryName = request.getRealPath("/") + "/Uploads/Companies/" + name + "/";
                      File theDir = new File(directoryName);
                      if (!theDir.exists())
                          theDir.mkdir();
  
                      File uploadedFile = new File(directoryName + cvFile.getName());
                      try
                      {
                          cvFile.write(uploadedFile);
                      }
                      catch(Exception e) {}
                  }
              }
  </code></pre>
  
  <p>I get a null exception here (in the last if statement):</p>
  
  <pre><code>File uploadedFile = new File(directoryName + cvFile.getName());
  </code></pre>