Multiple Uploads

Different Names

If a multipart request has multiple uploads that have different part names, create an argument to your route that receives each part. For example:

  1. HttpResponse upload(String title, String name)

A route method signature like the above expects two different parts, one named “title” and the other “name”.

Same Name

To receive multiple parts with the same part name, the argument must be a Publisher. When used in one of the following ways, the publisher emits one item per part found with the specified name. The publisher must accept one of the following types:

For example:

  1. HttpResponse upload(Publisher<StreamingFileUpload> files)
  2. HttpResponse upload(Publisher<CompletedFileUpload> files)
  3. HttpResponse upload(Publisher<MyObject> files)
  4. HttpResponse upload(Publisher<Publisher<PartData>> files)
  5. HttpResponse upload(Publisher<CompletedPart> attributes)