code: @Override
      public void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          Context context =
                  ReadOnlyContext.getContext(Constants.HTTP_REQUEST.REST.uri,
                                             request);
          try {
              // Create a new file upload handler
              ServletFileUpload upload = new ServletFileUpload();
  
              // Parse the request, looking for "file"
              InputStream in = null;
              FileItemIterator iter = upload.getItemIterator(request);
              while (in == null && iter.hasNext()) {
                  FileItemStream item = iter.next();
                  logger.info("Got next item: isFormField={} fieldName={}", item.isFormField(), item.getFieldName());
                  if (!item.isFormField() && item.getFieldName().equals("file")) {
                      in = item.openStream();
                  }
              }
              if (in == null) {
                  sendResponse(HttpServletResponse.SC_BAD_REQUEST,
                               "No data sent.",
                               response);
              } else {
                  sendResponse(HttpServletResponse.SC_CREATED,
                               m_management.putTempStream(context, in),
                               response);
              }
          } catch (AuthzException ae) {
              throw RootException.getServletException(ae,
                                                      request,
                                                      "Upload",
                                                      EMPTY_STRING_ARRAY);
          } catch (Exception e) {
              e.printStackTrace();
              sendResponse(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e
                      .getClass().getName()
                      + ": " + e.getMessage(), response);
          }
      }
docs: The servlet entry point. http://host:port/fedora/management/upload