code: public void addFilePart(String fieldName, File uploadFile) throws FileNotFoundException {
          stream.put(fieldName, new NamedInputStream(uploadFile.getName(), new FileInputStream(uploadFile), "binary", URLConnection.guessContentTypeFromName(uploadFile.getName())));
      }
docs: Adds a file to the request
  
  @param fieldName  name attribute
  @param uploadFile a File to be uploaded
  @throws FileNotFoundException