title: PUT Method: Not able to send "fileName" form Data using Jersey API using java?
body: <p>following is the code I have written to PUT a image to a jersey server.</p>
  
  <pre><code>        byte[] img = image(file);// coverts file into byte strea
  
  
      FormDataMultiPart form = new FormDataMultiPart();
      form.field("fileName", file);
      FormDataBodyPart fdp = new FormDataBodyPart("fileUpload",
              new ByteArrayInputStream(img),
              MediaType.APPLICATION_OCTET_STREAM_TYPE);
      form.bodyPart(fdp);
  
  
      ClientResponse rs = wr.type(MediaType.APPLICATION_FORM_URLENCODED).put(
              ClientResponse.class, form);
  </code></pre>
  
  <p>When I am running the code, i am able to send the byte stream to the server, but its returning error that it is not able to find the filename i am providing in form.field, so returning a 400 bad request error?</p>
  
  <p>i am not able to understand what i am missing here?</p>