[jboss-user] [JBoss Seam] - s:fileUpload working locally but not remote

tobias.hult do-not-reply at jboss.com
Fri Jul 20 10:45:43 EDT 2007


Hi,

I am using the s:fileUpload component in a webapp I am currently developing. When I run the webapp locally on my machine it works great. But when I deploy the app to our test server and try to upload a file the value-binding field is always null.

Does anyone know what the problem can be? I am running seam 1.2.1 and tomcat 5.5

Here's the code:

jspx page:
<s:fileUpload id="inUploadFile"
  |                         data="#{fileUploadBean.uploadedFile}"
  |                         fileName="#{fileUploadBean.fileName}"
  |                         contentType="#{fileUploadBean.contentType}"
  |                         styleClass="fileUploadInput" />
  | 
  |                     <h:commandButton id="submitFileAndClose" value="Upload" action="#{fileUploadBean.uploadFile}" />
  | 
bean:

  | private byte[] uploadedFile;
  | public byte[] getUploadedFile()
  |     {
  |     	log.debug("getUpFile called");
  |         return uploadedFile;
  |     }
  |     public void setUploadedFile(byte[] uploadedFile) {
  |         this.uploadedFile = uploadedFile;
  |     }
  | public String uploadFile() throws IOException
  |     {
  |         if (null == uploadedFile || uploadedFile.length < 1) { //This is always the case on the remote machine
  |             log.error("No file to upload. Aborting...");
  |             facesMessages.add("No file chosen");
  |             return "";
  |         }
  | ...
  | ...
  | ...
  | }
  | 
  | 

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

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



More information about the jboss-user mailing list