title: Severe error for using "multipart/form-data" for a file upload service - Apache Jersey
body: <p>I get this error: </p>
  
  <pre><code>SEVERE: Resource methods utilizing @FormParam and consuming "multipart/form-data" are no longer supported. See @FormDataParam
  </code></pre>
  
  <p>When a client web access is done for a Apache Jersey based Rest web service I am working right now:</p>
  
  <pre><code>@POST
  @Path("upload")
  @Consumes("multipart/form-data")
  @Produces("text/plain")
  public String uploadFile(@FormParam("file") File file, @FormParam("file") FormDataContentDisposition fileDetail) {
      String fileLocation = "/files/" + fileDetail.getFileName();
      System.out.println("File location: " + fileLocation);
      // Load image
      try {
          byte[] imageBytes = loadImage(fileLocation);
          MongoConnection conn = MongoUtil.getConnection();
          conn.connect("m1", "avatar"); 
          GridFS fs = new GridFS(conn.getDB());
          GridFSInputFile in = fs.createFile(imageBytes);
          in.save();
      } catch (Exception e) {
          e.printStackTrace();
      }
      return "1";
  }
  </code></pre>
  
  <p>I have tried changing from <code>@FormParam</code> to <code>@FormDataParam</code> but it's unresolved. </p>
  
  <p>What could be the fix for this?</p>