title: Primefaces Fileupload on Wildfly
body: <p>I am trying to save a profile image in a database.</p>
  
  <p>Page:</p>
  
  <pre><code>&lt;p:graphicImage id="profileImage"
                          value="#{myProfile.usersProfileImage}" /&gt;    
  &lt;p:fileUpload fileUploadListener="#{myProfile.fileUploadListener}"
                              auto="true" mode="advanced" update="profileImage"
                              sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" /&gt;
  </code></pre>
  
  <p>Backing:</p>
  
  <pre><code>public StreamedContent getUsersProfileImage() {
              return new DefaultStreamedContent(new ByteArrayInputStream(
                      user.getProfileJpegImage()));
      }    
  public void fileUploadListener(FileUploadEvent event) {
          try {
              setProfileImageFromInputStream(event.getFile().getInputstream());
          } catch (IOException e) {
              throw new IllegalStateException(e);
          }
      }
  
      private void setProfileImageFromInputStream(InputStream stream) {
          try {
              user.setProfileJpegImage(IOUtils.toByteArray(stream));
          } catch (IOException e) {
              throw new IllegalStateException(e);
          }
      }
  </code></pre>
  
  <p>After choosing a picture the picture does not change and I got following error in my console</p>
  
  <pre><code>14:36:02,387 ERROR [io.undertow.request] (default task-2) UT005005: Cannot remove uploaded file C:\Development\wildfly-8.0.0.Final\standalone\tmp\myApp.war\undertow3307538071115388117upload
  </code></pre>
  
  <p>I also found this issue
  <a href="https://issues.jboss.org/browse/WFLY-2329">https://issues.jboss.org/browse/WFLY-2329</a></p>
  
  <p>and I also tried to extend my Faces Servlet with a multipart-config like:</p>
  
  <pre><code>&lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
          &lt;multipart-config&gt;
              &lt;max-file-size&gt;20848820&lt;/max-file-size&gt;
              &lt;max-request-size&gt;418018841&lt;/max-request-size&gt;
              &lt;file-size-threshold&gt;1048576&lt;/file-size-threshold&gt;
          &lt;/multipart-config&gt;
      &lt;/servlet&gt;
  </code></pre>
  
  <p>but nothing changed.</p>
  
  <p>Any ideas?
  TY in advanced</p>