2 Replies Latest reply on Dec 25, 2008 9:48 PM by Raghunath Nandy

    Problem with Seam Fileupload

    Raghunath Nandy Newbie

      Hi
      Im trying to upload a file using s:fileUpload .


      <s:validateAll>
                  <s:decorate id="valueField" template="layout/edit.xhtml">
                      <ui:define name="label">Value</ui:define>
                             <s:fileUpload id="picture" value="#{upload.picture}" accept="image/png"
                                   contentType="#{upload.pictureContentType}"/>
                                    
                                    </s:decorate>
           </s:validateAll>
      



      And the action is



      @Name("upload")
      public class Upload
      {
          @Logger private Log log;
          
          private byte[] picture;
          private String pictureContentType;
          
          public byte[] getPicture() {
                return picture;
           }
      
           public void setPicture(byte[] picture) {
                this.picture = picture;
           }
      
           public String getPictureContentType() {
                return pictureContentType;
           }
      
           public void setPictureContentType(String pictureContentType) {
                this.pictureContentType = pictureContentType;
           }
      
           
          public void upload()
          {
               log.info(pictureContentType);
            log.info(picture);
               
          }
      
      }
      



      I'm not able to get the file data in the action. It's always showing null..


      plz help me


      thanks
      raghu