FileUploadEvent Primefaces files in the root of the application server

0

We have implemented the implementation of FileForce of Primefaces and it works well, however we are presenting an inconvenience that we do not know its nature. When we call the listener methods for uploading files, a copy of the file is created in the root directory of the application server, which is inconvenient since the junk file server arrives, just after going through the method with the event listener:

This is the method we call, if we comment on the line evento.getFile () the file is not created:

public void subirArchivos(FileUploadEvent evento) {
        try {
            archivo = evento.getFile();
        } catch (Exception e) {
            procesarError(e);
        }
    }

This is the code used in the primefaces page to implement the fileUpload:

                                                                                                                                

We have configured both the filter for commons and the listener for apache fileUpload that is responsible for cleaning temporary files, in fact the files are created in the specified directory and are deleted correctly, only that the copy is also generated in the application server, we suspect that by executing the fileUploadEvent.getFile () method:

<context-param>
        <param-name>primefaces.UPLOADER</param-name>
        <param-value>auto</param-value>
    </context-param>

...

  <filter>
    <filter-name>PrimeFaces FileUpload Filter</filter-name>
    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
    <init-param>
        <param-name>thresholdSize</param-name>
          <param-value>204800</param-value>
    </init-param>
    <init-param>
        <param-name>uploadDirectory</param-name>
         <param-value>/u/home/avaluos/tmp/</param-value>
    </init-param>
  </filter>
  <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>


...


<listener>
        <listener-class>org.apache.commons.fileupload.servlet.FileCleanerCleanup</listener-class>
</listener>

We are generating this application with the following versions of the libraries:

<groupId>org.primefaces</groupId>
<version>6.0</version>

<groupId>commons-fileupload</groupId>
<version>1.3</version>

<groupId>commons-io</groupId>
<version>2.5</version>

Servidor weblogic 12.1.3.0.0
    
asked by Zaid Yussef Tilaguy 29.06.2018 в 17:53
source

0 answers