2 Replies Latest reply on Apr 15, 2008 5:08 PM by Casey Boyd

    Anyone have the new rich:fileUpload working?

    Casey Boyd Newbie

      Components.xml



           <component class="org.jboss.seam.web.MultipartFilter">
               <property name="createTempFiles">true</property>
               <property name="maxRequestSize">200</property>     
           </component> 




      xhtml



      <h:form enctype="multipart/form-data" >
      
                               <rich:fileUpload uploadData="#{bean.data}" fileUploadListener="#{bean.listener}">
                                    <f:facet name="File">
                                         <h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />
                                    </f:facet>
                               </rich:fileUpload>
      
      </h:form>



      bean



      public class Bean{
      
      private byte[] data;
          public byte[] getData() { return this.data; }
          public void setData(byte[] data) { this.data = data; }
      
      
          public void listener(UploadEvent event) throws IOException {
               
               try{
               
                    UploadItem item = event.getUploadItem();
           
                   if (item.isFile()) {
                        log.info(item.getData().length);
                        log.info("item.getFileName());
           
                   }
               
               }catch(Exception e){
      
               }
          }
      
      }



      Is this still a problem?


      Jira Bug


      Thanks


      Indy