[jboss-user] [JBoss Seam] - <s:fileUpload/> IE/Firefox Filename differences

chane do-not-reply at jboss.com
Tue Apr 17 10:53:15 EDT 2007


I'm using Seam1.2.0patch1.

The filename parameter on <s:fileUpload/> is different between IE and Firefox.  On Firefox, I get just the filename.  On IE (6.x), the path + filename is returned.

Is this expected?

My page is:

  | <h:form enctype="multipart/form-data" id="f1">
  |    <h:commandLink action="#{backing.uploadFile}" value="Upload"/>
  |    <s:fileUpload id="importfile" data="#{backing.dataFile}"
  |                        fileName="${backing.fileName}"/>
  | </h:form>
  | 

My Bean Action is:

  | public String uploadFile(){
  |       
  |       if(dataFile==null || dataFile.length==0){
  |          facesMessages.add("File was empty!");
  |          return FORM_UPLOAD;
  |       }
  |       
  |       verifyDirectory(step.getTemplatePath());
  |       
  |       File file = new File(step.getTemplatePath() + fileName);
  |       if(file.exists()){
  |          facesMessages.add("File already exsits! ");
  |          return "formUpload";
  |       }
  |       
  |       OutputStream bos=null;
  |       bos = new FileOutputStream(file);
  |       for(int x=0; x<dataFile.length; x++){
  |          bos.write(dataFile[x]);
  |       }
  |       return "success";
  |    }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037993#4037993

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037993



More information about the jboss-user mailing list