code: public String upload(final File file) throws IOException {
          if (Administrator.INSTANCE == null) {
              return fc.uploadFile(file);
          } else {
              // paint initial status to the progress bar
              String msg =
                      "Uploading " + file.length() + " bytes to "
                              + fc.getUploadURL();
              Dimension d = Administrator.PROGRESS.getSize();
              Administrator.PROGRESS.setString(msg);
              Administrator.PROGRESS.setValue(100);
              Administrator.PROGRESS.paintImmediately(0,
                                                      0,
                                                      (int) d.getWidth() - 1,
                                                      (int) d.getHeight() - 1);
  
              // then start the thread, passing parms in
              SwingWorker<String> worker = new SwingWorker<String>() {
  
                  @Override
                  public String construct() {
                      try {
                          return fc.uploadFile(file);
                      } catch (IOException e) {
                          thrownException = e;
                          return "";
                      }
                  }
              };
              worker.start();
  
              // keep updating status till the worker's finished
              int ms = 200;
              while (!worker.done) {
                  try {
                      Administrator.PROGRESS.setValue(ms);
                      Administrator.PROGRESS.paintImmediately(0, 0, (int) d
                              .getWidth() - 1, (int) d.getHeight() - 1);
                      Thread.sleep(100);
                      ms = ms + 100;
                      if (ms >= 2000) {
                          ms = 200;
                      }
                  } catch (InterruptedException ie) {
                  }
              }
  
              // reset the status bar to normal
              Administrator.PROGRESS.setValue(2000);
              Administrator.PROGRESS.paintImmediately(0,
                                                      0,
                                                      (int) d.getWidth() - 1,
                                                      (int) d.getHeight() - 1);
              try {
                  Thread.sleep(100);
              } catch (InterruptedException ie) {
              }
  
              // report if there was an error; otherwise return the response
              if (worker.thrownException != null) {
                  throw (IOException) worker.thrownException;
              } else {
                  return (String) worker.getValue();
              }
  
          }
      }
docs: Send a file to the server, getting back the identifier.