Problem upload image with more than 10mb primefaces

1

Guys, I'm going through a pretty annoying and seemingly simple problem and I have not found a solution yet, can anyone help me? I am using the upload of primefaces and it simply does not upload files larger than 10mb ... A 9.9mb file goes normal. = o

Would you like to know where I change to increase this limit?

Here is the code I'm using:

<p:fileUpload multiple="false"  cancelLabel="Cancelar" label="Selecionar Brasão..." fileUploadListener="#{back.uploadArquivo}" mode="advanced" dragDropSupport="true" auto="false" 
         fileLimit="1" sizeLimit="51380224"    update="panel_grid_upload_arquivo, :growl" />

back:

  public void uploadArquivo(FileUploadEvent event) {
    DocumentoEntity arquivo = new DocumentoEntity();
    try {
        arquivo.setArquivo(IOUtils.toByteArray(event.getFile().getInputstream()));
        arquivo.setNomeArquivo(event.getFile().getFileName());
        arquivo.setNome(event.getFile().getFileName());
        this.arquivo = arquivo;
        exibirMensagemSucesso("Upload feito com sucesso", "O arquivo agora está associado ao documento");
    } catch (IOException e) {
        exibirMensagemErro("Ocorreu algum erro", "Ocorreu algum erro e o upload não pôde ser feito");
        LOGGER.error("Não realizou o upload do arquivo");
        e.printStackTrace();
    }

}

My web.xml has these settings:

<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

A file larger than 10mb does not even reach the bean. Thanks in advance for any help!

    
asked by anonymous 10.12.2014 / 17:05

1 answer

2

I discovered the problem after a few hours ... and it was actually quite simple. This error happened because of wildfly 8! Since it limits the maximum size of the "post" requestions. I had to put max-post-size="50485760" in standalone.xml and now it works fine.

This is what the standalone.xml excerpt says:

<server name="default-server">
        <http-listener name="default" socket-binding="http" max-post-size="50485760"/>
        <host name="default-host" alias="localhost">
            <location name="/" handler="welcome-content"/>
            <filter-ref name="server-header"/>
            <filter-ref name="x-powered-by-header"/>
        </host>
    </server>
    
28.12.2014 / 13:00