title: MultiPart File Upload with Quarkus / Kotlin
body: <p>I am trying to build a multi-part file upload REST route in Quarkus (using Kotlin), but having issues with the route mapping.</p>
  <p>From the Client side I am posting a form that contains a text value and a file value.</p>
  <pre><code>const formData = new FormData();
  formData.append(&quot;text&quot;, text);
  formData.append(&quot;file&quot;, files[0]);
  
  fetch('http://localhost:8080/data', {
     method: 'POST',
     body: formData
  })
  </code></pre>
  <p>From the serverside, I am trying to retrieve the values as follows.</p>
  <pre><code>class FormData(@FormParam(&quot;text&quot;) @PartType(MediaType.TEXT_PLAIN) var text:String,
                @FormParam(&quot;file&quot;) @PartType(MediaType.APPLICATION_OCTET_STREAM) var file:InputStream)
  
  @Path(&quot;/data&quot;)
  class FormUploadResource {
  
      @POST
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      fun upload(@MultipartForm form:FormData) {
          println(form.text)
          println(form.file)
      }
  }
  </code></pre>
  <p>However, when I execute the endpoint, I get a <strong>org.jboss.resteasy.spi.ReaderException: java.lang.NoSuchMethodException:</strong> error.</p>
  <p>I have tried to make sure that the text and file parameters are correctly being received, and have inspected the payload coming in with the following code</p>
  <pre><code>@POST
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  fun upload(input:MultipartFormDataInput) {
      var map = input.getFormDataMap()
      map.entries.forEach {
          println(&quot;&quot;&quot;${it.key} - ${it.value}&quot;&quot;&quot;) 
          if (it.value is List&lt;InputPart&gt;) {
              it.value.forEach { ip -&gt;
                  println(&quot;&quot;&quot; --- ${ip.getMediaType()} &quot;&quot;&quot; ) 
              }
          }
      }
  }
  </code></pre>
  <p>And it correctly says</p>
  <pre><code>text - [org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl$PartImpl@660c4317]
   --- text/plain;charset=UTF-8
  file - [org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl$PartImpl@3aee346]
   --- application/octet-stream;charset=UTF-8
  </code></pre>
  <p>I assume there is something going wrong with the FormData class that RestEasy isn't automagically mapping to it. I have tried changing the type for &quot;file&quot; to be ByteArray and File, and they both fail also.</p>
  <p>I have struggled to find Kotlin specific answers, so it is possible this is a Kotlin oddity also.</p>