0 Replies Latest reply on Feb 14, 2011 5:13 AM by bhanu prakash yadav

    upload of text file in to rich:fileupload ....

    bhanu prakash yadav Newbie
      Hi all,
      iam facing a problm in uploading a text file into rich: fileupload >>>>>i am able to store JPG and PNG formats but text is not getting uploaded ......

      my jsp code :

      <h:panelGroup id="fileUploadPanel">
                                         <s:decorate id="filedec">
                                              <table cellspacing="0" cellpadding="0">
                                                        <rich:fileUpload id="upload"
                                                             listHeight="80px"  acceptedTypes="jpg, png, bmp, txt">                                                       
                                                        <s:message errorClass="error"/>

      my action for it >>>>

           public void confirmAttachment() {

              Resource oldResource = new Resource();
                if (this.employeeAttachment.getAttachment() != null) {
                     oldResource = this.employeeAttachment.getAttachment();
                if (oldResource != null) {
                     if (this.resource == null || this.resource.getId() != oldResource.getId()) {

                if (this.resource != null) {

                if (selectedInstance instanceof IcBusiness) {
                     this.employeeAttachment.setInstance(((IcBusiness) selectedInstance)
                } else if (selectedInstance instanceof Provider) {
                     this.employeeAttachment.setInstance(((Provider) selectedInstance)


      plz guide me in this if u have any ideas to share...