Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-99179

Allow plugin REST resources to iterate over multipart form fields

XMLWordPrintable

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      REST resources can currently access MultiPart form contents in the following ways:

      @POST
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      @Path("/path")
      public Response postMethod(@MultipartFormParam("field1") FilePart file,
                                 @MultipartFormParam("field2") List<FilePart> files,
                                 @Context MultipartHandler multipartHandler,
                                 @Context HttpServletRequest request) {
          MultipartForm form = multipartHandler.getForm(request);
          Collection<FilePart> fileParts = form.getFileParts("field3");

      However, there is currently no way to access parts for which a field name is not specified - i.e. determined by the client.

      This is in contrast to Struts MultiPart requests where all fields can be iterated over.

      This limitation prevents the migration of Struts Actions which rely on dynamic multipart form fields to a REST equivalent.

              854eef6f5746 Kusal Kithul-Godage
              854eef6f5746 Kusal Kithul-Godage
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: