docs: public void doUpload(HttpServletRequest request, HttpServletResponse response)
              throws IOException, ServletException
      {
          MultipartConfigElement multipartConfigElement = new MultipartConfigElement("/tmp");
          request.setAttribute("org.eclipse.multipartConfig", multipartConfigElement);
          if (!common.checkPost(request, response)) return;
          User user = common.requireLoggedInUser(request, response);
          if (user == null) return;
  
          DbxClientV2 dbxClient = requireDbxClient(request, response, user);
          if (dbxClient == null) return;
  
          try {
              request.getParts();  // Just call getParts() to trigger the too-large exception.
          }
          catch (IllegalStateException ex) {
              response.sendError(400, "Request too large");
              return;
          }
  
          String targetFolder = slurpUtf8Part(request, response, "targetFolder", 1024);
          if (targetFolder == null) return;
  
          Part filePart = request.getPart("file");
          if (filePart == null) {
              response.sendError(400, "Field \"file\" is missing.");
              return;
          }
          String fileName = filePart.getName();
          if (fileName == null) {
              response.sendError(400, "Field \"file\" has no name.");
              return;
          }
  
          // Upload file to Dropbox
          String fullTargetPath = targetFolder + "/" + fileName;
          FileMetadata metadata;
          try {
              metadata = dbxClient.files()
                  .upload(fullTargetPath)
                  .uploadAndFinish(filePart.getInputStream());
          }
          catch (DbxException ex) {
              common.handleDbxException(response, user, ex, "upload(" + jq(fullTargetPath) + ", ...)");
              return;
          }
          catch (IOException ex) {
              response.sendError(400, "Error getting file data from you.");
              return;
          }
  
          // Display uploaded file metadata.
          response.setContentType("text/html");
          response.setCharacterEncoding("utf-8");
          PrintWriter out = new PrintWriter(new OutputStreamWriter(response.getOutputStream(), "UTF-8"));
  
          out.println("<html>");
          out.println("<head><title>File uploaded: " + escapeHtml4(metadata.getPathLower()) + "</title></head>");
          out.println("<body>");
          out.println("<h2>File uploaded: " + escapeHtml4(metadata.getPathLower()) + "</h2>");
          out.println("<pre>");
          out.print(escapeHtml4(metadata.toStringMultiline()));
          out.println("</pre>");
          out.println("</body>");
          out.println("</html>");
  
          out.flush();
      }