Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3469

Add multipart request support to HandleHttpRequest Processor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Extensions
    • None

    Description

      Currently, HandleHttpRequest outputs a single FlowFile containing all multipart values as following:

      --------------------------ef07e8bf36c274d3
      Content-Disposition: form-data; name="p1"
      v1
      --------------------------ef07e8bf36c274d3
      Content-Disposition: form-data; name="p2"
      v2
      --------------------------ef07e8bf36c274d3--
      

      Many users requested adding upload files support to NiFi.

      In order for HandleHttpRequest to support multipart data we need to add followings (this is based on a brief researching and can be more complex or simple):

      We need to use HttpServletRequest#getParts() as written in this stackoverflow thread:
      http://stackoverflow.com/questions/3337056/convenient-way-to-parse-incoming-multipart-form-data-parameters-in-a-servlet

      Also, we probably need a custom MultiPartInputStreamParser implementation. Because Jetty's default implementation writes input data to temporary directory on file system, instead, we'd like NiFi to write those into output FlowFiles content in streaming fashion.

      And we need request size validation checks, threshold for those validation should be passed via javax.servlet.MultipartConfigElement.

      Finally, we have to do something with HandleHttpResponse processor.
      Once HandleHttpRequest processor start splitting incoming request into multiple output FlowFiles, we need to wait for every fragment to be processed, then execute HandleHttpRequest.
      I think Wait/Notify processors (available from next version) will be helpful here.

      Attachments

        Issue Links

          Activity

            People

              andrewsmith87 Endre Kovacs
              ijokarumawak Koji Kawamura
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: