First of all a greeting and thanks in advance.
The reason for my creating this thread is because of an error that it generates when trying to load a file with
what I want is to capture a file, regardless of its extension, send it to the controller and then convert it to bytearray to store it in a postgre sql database.
<div class="row">
              <div class=" text-mini col-lg-12 col-md-6 col-xs-6">
                <h:form enctype="multipart/form-data">
                <h:panelGrid columns="2">
                    <h:outputLabel value="Cargar archivo" for="fileUpload" />
                    <h:inputFile value="#{fileUploadFormBean.fileUpload}" id="fileUpload" />
                    <h:commandButton value="Cargar"/>
                </h:panelGrid>
            </h:form> 
           </div>
             </div>
             <div class="row">
              <div class="col-lg-12">
               <h:panelGrid rendered="#{not empty(fileUploadFormBean.fileUpload)}" columns="2"  >
                  
                  <h:outputText value="fileName:" />
                  <h:outputText value="#{fileUploadFormBean.fileUpload.submittedFileName}" />
                  <h:outputText value="contentType:" />
                  <h:outputText value="#{fileUploadFormBean.fileUpload.contentType}" />
                  <h:outputText value="size:" />
                  <h:outputText value="#{fileUploadFormBean.fileUpload.size}" />
               </h:panelGrid>
              </div>
             </div>package com.esmero.cl.mvno.ticketin.controller;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.servlet.http.Part;
@ManagedBean(name = "filecontroller")
@ViewScoped
public class UpLoadFileController implements Serializable{
 private static final long serialVersionUID = 1L;
     private Part fileUpload;
     /**
      * Creates a new instance of FileUploadFormBean
      */
     public UpLoadFileController() {
     }
     public Part getFileUpload() {
         return fileUpload;
     }
     public void setFileUpload(Part fileUpload) {
         this.fileUpload = fileUpload;
     }
}
 