4 Replies Latest reply on Jun 30, 2010 7:11 AM by Stephen Friedrich

    filupload through resteasy with MultipartFormDataInput and the SeamFilter

    Georges Goebel Newbie
      Hi

      I try to upload a file with resteasy and I have a question about the seam filter.

      My html page does a simple POST operation

      `
      <form method="POST" action="http://hpgoebel.pch.etat.lu:8080/arcgisServerWS/seam/resource/rest/Accident/upload/process/9" enctype="multipart/form-data">

      <input type="file" size="50" name="file" id="file">
      <input type="submit" value="Upload now!">

      </form>
      `

      The methode signature of the corresponding resteasy bean is as follows :

      `
      @POST
      @Path("/upload/process/{noAccident}")
      @Consumes("multipart/form-data")
      public void upload(MultipartFormDataInput input, @PathParam("noAccident") String noAccident) {
      `
      When I define the Seam Filter in the web.xml the code does not work !
      Removing the seam filter solves the Problem !



      `
      filter-mapping
           filter-name Seam Filter filter-name
           url-pattern\\url-pattern
      filter-mapping
      `



      I suspect that the filter consumes the stream in the request and therefore the 'MultipartFormDataInput' does not find the fileupload data.
      Is it possible to disable the filter for some urls (f.ex seam/resources/*)
      Probably I also did something wrong. So I would be happy to hear if somebody has the same problem or even better a solution


      The exception is :

      `
      15:14:13,263 WARN  [MimeEntity] Unexpected end of headers detected. Higher level boundary detected or EOF reached.
      15:14:13,263 WARN  [MimeEntity] Invalid header encountered
      15:14:13,283 WARN  [MimeEntity] Body part ended prematurely. Boundary detected in header or EOF reached.
      .....
      Caused by: java.lang.RuntimeException: Could find no Content-Disposition header within part
      `

      Georges