title: struts 2 File Upload and Save problem
body: <p>The file is uploaded successfully but it is not getting saved</p>
  
  <p>This is the function in my action class</p>
  
  <pre><code>public String uploadPhoto()
  {
      HttpServletRequest request = ServletActionContext.getRequest();
      String filePath = request.getContextPath();
      File fileToCreate = new File(filePath, this.userImageFileName);
  
  try {
          FileUtils.copyFile(this.userImage, fileToCreate);
          Users user =   userDao.findByUsername((String)session.get("username"));
          user.setPhotoName(filePath+userImageFileName);
          userDao.save(user);
      } catch (IOException e) {
          addActionError(e.getMessage());
          e.printStackTrace();
          return INPUT;
      }
  
      return "UPLOADED";
  }
  </code></pre>
  
  <p>I used breakpoints and all statements are executed successfully</p>
  
  <p>But I see no file in my context root</p>