action:  package welcome;import org.apache.struts.action.*;
import javax.servlet.http.*;
import welcome.*;
import org.apache.struts.upload.FormFile;
import java.io.*;
public class fileAction extends Action {
  public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {    DynaActionForm fileactionForm = (DynaActionForm) actionForm;
   if(fileactionForm!=null)
   {
     System.out.println("formbean is not null");
     FormFile file=(FormFile)fileactionForm.get("file1");
     if(file!=null)
     {
       System.out.println("file is not null");
       String name=file.getFileName();
       System.out.println("name:"+name);
       try{
         byte[] content1 = file.getFileData();
         String content2=new String(content1);
         File file1=new File("f:\\"+name);
         FileOutputStream out=new FileOutputStream(file1);
         out.write(content1);
         out.close();
        
         System.out.println(content2);
       }
       catch(Exception e_22)
       {
         System.out.println(e_22);
       }
     }   }
   return actionMapping.findForward("back");
  }
}
form:
package welcome;
import java.io.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.struts.upload.FormFile;public class fileActionForm extends ActionForm {
  public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
  }
  private FormFile file1;
  public void setFile1(FormFile file1)
  {
    this.file1=file1;
  }
  public FormFile getFile1()
  {
    return this.file1;
  }
  public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
  }
}
xml:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
  <form-beans>
    <form-bean name="fileactionForm" type="org.apache.struts.action.DynaActionForm">
     <form-property name="file1" type="org.apache.struts.upload.FormFile"/>
      </form-bean>
  </form-beans>
  <action-mappings>
    <action name="fileactionForm" path="/fileaction" scope="request" type="welcome.fileAction">
     <forward name="back" path="/jsp1.jsp">
     </forward> 
    </action>
    </action-mappings>
</struts-config>
jsp :你自己 写了哈,.....